aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorРоман Донченко <dpb@corrigendum.ru>2016-12-05 22:43:21 +0300
committerPeter Wu <peter@lekensteyn.nl>2016-12-06 01:15:13 +0000
commitf96e9d067ba314c947a3caeafc909e9542042a64 (patch)
tree20c05c7751c6153bfd1b096513318e6bfe72dcec
parent38f45e1e222589987d95e79f59430403f40bdd49 (diff)
downloadwireshark-f96e9d067ba314c947a3caeafc909e9542042a64.tar.gz
wireshark-f96e9d067ba314c947a3caeafc909e9542042a64.tar.bz2
wireshark-f96e9d067ba314c947a3caeafc909e9542042a64.zip
ssh: add dissection for ECDSA host keys
Change-Id: Ic9851976bfa25fc61c708ee08e5a26ad01769f06 Reviewed-on: https://code.wireshark.org/review/19097 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-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 c91553f909..0a39061a4c 100644
--- a/epan/dissectors/packet-ssh.c
+++ b/epan/dissectors/packet-ssh.c
@@ -148,6 +148,10 @@ 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_hostkey_ecdsa_curve_id= -1;
+static int hf_ssh_hostkey_ecdsa_curve_id_length= -1;
+static int hf_ssh_hostkey_ecdsa_q= -1;
+static int hf_ssh_hostkey_ecdsa_q_length= -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;
@@ -661,6 +665,11 @@ ssh_tree_add_hostkey(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const c
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 if (g_str_has_prefix(key_type, "ecdsa-sha2-")) {
+ offset += ssh_tree_add_string(tvb, offset, tree,
+ hf_ssh_hostkey_ecdsa_curve_id, hf_ssh_hostkey_ecdsa_curve_id_length);
+ ssh_tree_add_string(tvb, offset, tree,
+ hf_ssh_hostkey_ecdsa_q, hf_ssh_hostkey_ecdsa_q_length);
} else {
remaining_len = key_len - (type_len + 4);
proto_tree_add_item(tree, hf_ssh_hostkey_data, tvb, offset, remaining_len, ENC_NA);
@@ -1302,6 +1311,26 @@ proto_register_ssh(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
+ { &hf_ssh_hostkey_ecdsa_curve_id,
+ { "ECDSA elliptic curve identifier", "ssh.host_key.ecdsa.id",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_ecdsa_curve_id_length,
+ { "ECDSA elliptic curve identifier length", "ssh.host_key.ecdsa.id_length",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_ecdsa_q,
+ { "ECDSA public key (Q)", "ssh.host_key.ecdsa.q",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_ssh_hostkey_ecdsa_q_length,
+ { "ECDSA public key length", "ssh.host_key.ecdsa.q_length",
+ FT_UINT32, BASE_DEC, 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,