aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorРоман Донченко <dpb@corrigendum.ru>2016-12-01 01:44:52 +0300
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-12-01 06:22:12 +0000
commit58746cb6d6a4ef7dafa28289bbab13c32e1ae6fe (patch)
treef78fd43f9065f8a835a82e4fa66fedf791831933
parentcbf89c8ed842a58c282872cf8c42adf9b8b2ffee (diff)
ssh: add DSA host key dissection
Change-Id: Ib1e2b4e57832e94b94d34102c0079f820b18f350 Reviewed-on: https://code.wireshark.org/review/19000 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-ssh.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c
index 505b7cc698..5cbd1548ec 100644
--- a/epan/dissectors/packet-ssh.c
+++ b/epan/dissectors/packet-ssh.c
@@ -145,6 +145,10 @@ static int hf_ssh_hostkey_type= -1;
static int hf_ssh_hostkey_data= -1;
static int hf_ssh_hostkey_rsa_n= -1;
static int hf_ssh_hostkey_rsa_e= -1;
+static int hf_ssh_hostkey_dsa_p= -1;
+static int hf_ssh_hostkey_dsa_q= -1;
+static int hf_ssh_hostkey_dsa_g= -1;
+static int hf_ssh_hostkey_dsa_y= -1;
static int hf_ssh_kexdh_h_sig= -1;
static int hf_ssh_kexdh_h_sig_length= -1;
static int hf_ssh_kex_algorithms = -1;
@@ -653,6 +657,11 @@ ssh_tree_add_hostkey(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const c
if (0 == strcmp(key_type, "ssh-rsa")) {
offset += ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_rsa_e);
ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_rsa_n);
+ } else if (0 == strcmp(key_type, "ssh-dss")) {
+ offset += ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_dsa_p);
+ offset += ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_dsa_q);
+ offset += ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_dsa_g);
+ ssh_tree_add_mpint(tvb, offset, tree, hf_ssh_hostkey_dsa_y);
} else {
remaining_len = key_len - (type_len + 4);
proto_tree_add_item(tree, hf_ssh_hostkey_data, tvb, offset, remaining_len, ENC_NA);
@@ -1280,6 +1289,26 @@ proto_register_ssh(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
+ { &hf_ssh_hostkey_dsa_p,
+ { "DSA prime modulus (p)", "ssh.host_key.dsa.p",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_dsa_q,
+ { "DSA prime divisor (q)", "ssh.host_key.dsa.q",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_dsa_g,
+ { "DSA subgroup generator (g)", "ssh.host_key.dsa.g",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_dsa_y,
+ { "DSA public key (y)", "ssh.host_key.dsa.y",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
{ &hf_ssh_kexdh_h_sig_length,
{ "KEX DH H signature length", "ssh.kexdh.h_sig_length",
FT_UINT32, BASE_DEC, NULL, 0x0,