SSH: Display Host Key Type Length
authorDaniel Hirschberger <daniel.hirschberger+wireshark@rub.de>
Wed, 24 Oct 2018 15:30:22 +0000 (17:30 +0200)
committerAnders Broman <a.broman58@gmail.com>
Thu, 25 Oct 2018 06:36:19 +0000 (06:36 +0000)
Currently the type length of the host key is parsed but not displayed.
This commit fixes that.

Change-Id: I3db149129609c3ec5cd24e1031c35481ce3d2f81
Reviewed-on: https://code.wireshark.org/review/30375
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-ssh.c

index 700ef8a0dcc6b93918e11648533ecf873e9a68e4..f703de4a1b96b607296a6fb87c06e31ed5c2b2dd 100644 (file)
@@ -153,6 +153,7 @@ static int hf_ssh_kex_reserved = -1;
 
 /* Key exchange common elements */
 static int hf_ssh_hostkey_length = -1;
+static int hf_ssh_hostkey_type_length = -1;
 static int hf_ssh_hostkey_type = -1;
 static int hf_ssh_hostkey_data = -1;
 static int hf_ssh_hostkey_rsa_n = -1;
@@ -675,6 +676,7 @@ ssh_tree_add_hostkey(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const c
                                   tree_title);
 
     proto_tree_add_uint(tree, hf_ssh_hostkey_length, tvb, last_offset, 4, key_len);
+    proto_tree_add_uint(tree, hf_ssh_hostkey_type_length, tvb, last_offset +4, 4, type_len);
     proto_tree_add_string(tree, hf_ssh_hostkey_type, tvb, offset, type_len, key_type);
     offset += type_len;
 
@@ -1436,6 +1438,11 @@ proto_register_ssh(void)
             FT_UINT32, BASE_DEC, NULL, 0x0,
             NULL, HFILL }},
 
+        { &hf_ssh_hostkey_type_length,
+          { "Host key type length",         "ssh.host_key.type_length",
+            FT_UINT32, BASE_DEC, NULL, 0x0,
+            NULL, HFILL }},
+
         { &hf_ssh_hostkey_type,
           { "Host key type",         "ssh.host_key.type",
             FT_STRING, BASE_NONE, NULL, 0x0,