aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ssl.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-05-05 14:01:11 +0000
committerEvan Huus <eapache@gmail.com>2013-05-05 14:01:11 +0000
commit39abf7ca0a7fcfce767896bd1415e6bccb69bff9 (patch)
tree3e64144c2b1227c188778ace042062de9befd3bc /epan/dissectors/packet-ssl.c
parent79b3d4e32f55ecd80b3a79ab7215154d6d84027c (diff)
From Hauke Mehrtens via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8567
[PATCH 3/8] Detect PSK and RSA_PSK key exchange [PATCH 4/8] Dissect the identity hint for PSK and RSA_PSK key exchanges [From me] Using proto_tree_add_item instead of proto_tree_add_uint in one place svn path=/trunk/; revision=49173
Diffstat (limited to 'epan/dissectors/packet-ssl.c')
-rw-r--r--epan/dissectors/packet-ssl.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index e8b70ec3c1..56f18c011b 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -205,6 +205,8 @@ static gint hf_ssl_handshake_client_keyex_point = -1;
static gint hf_ssl_handshake_server_keyex_modulus = -1;
static gint hf_ssl_handshake_server_keyex_exponent = -1;
static gint hf_ssl_handshake_server_keyex_sig = -1;
+static gint hf_ssl_handshake_server_keyex_hint_len = -1;
+static gint hf_ssl_handshake_server_keyex_hint = -1;
static gint hf_ssl_handshake_sig_hash_alg_len = -1;
static gint hf_ssl_handshake_sig_hash_algs = -1;
static gint hf_ssl_handshake_sig_hash_alg = -1;
@@ -586,6 +588,10 @@ static void dissect_ssl3_hnd_srv_keyex_rsa(tvbuff_t *tvb,
proto_tree *tree,
guint32 offset, guint32 length);
+static void dissect_ssl3_hnd_srv_keyex_psk(tvbuff_t *tvb,
+ proto_tree *tree,
+ guint32 offset, guint32 length);
+
static void dissect_ssl3_hnd_cli_keyex_ecdh(tvbuff_t *tvb,
proto_tree *tree,
guint32 offset, guint32 length);
@@ -2051,6 +2057,10 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
case KEX_ECDH:
dissect_ssl3_hnd_srv_keyex_ecdh(tvb, ssl_hand_tree, offset, length);
break;
+ case KEX_RSA_PSK:
+ case KEX_PSK:
+ dissect_ssl3_hnd_srv_keyex_psk(tvb, ssl_hand_tree, offset, length);
+ break;
default:
break;
}
@@ -3370,6 +3380,32 @@ dissect_ssl3_hnd_srv_keyex_rsa(tvbuff_t *tvb, proto_tree *tree,
}
+/* Used in RSA PSK and PSK cipher suites */
+static void
+dissect_ssl3_hnd_srv_keyex_psk(tvbuff_t *tvb, proto_tree *tree,
+ guint32 offset, guint32 length)
+{
+ guint hint_len;
+ proto_item *ti_psk;
+ proto_tree *ssl_psk_tree;
+
+ hint_len = tvb_get_ntohs(tvb, offset);
+ if ((2 + hint_len) != length) {
+ /* Lengths don't line up (wasn't what we expected?) */
+ return;
+ }
+
+ ti_psk = proto_tree_add_text(tree, tvb, offset,
+ length, "PSK Server Params");
+ ssl_psk_tree = proto_item_add_subtree(ti_psk, ett_ssl_keyex_params);
+
+ /* hint */
+ proto_tree_add_item(ssl_psk_tree, hf_ssl_handshake_server_keyex_hint_len,
+ tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ssl_psk_tree, hf_ssl_handshake_server_keyex_hint,
+ tvb, offset + 2, hint_len, ENC_NA);
+}
+
static void
dissect_ssl3_hnd_cli_keyex_dh(tvbuff_t *tvb, proto_tree *tree,
@@ -5399,6 +5435,16 @@ proto_register_ssl(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
"Diffie-Hellman server signature", HFILL }
},
+ { &hf_ssl_handshake_server_keyex_hint_len,
+ { "Hint Length", "ssl.handshake.hint_len",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Length of PSK Hint", HFILL }
+ },
+ { &hf_ssl_handshake_server_keyex_hint,
+ { "Hint", "ssl.handshake.hint",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "PSK Hint", HFILL }
+ },
{ &hf_ssl_handshake_sig_hash_alg_len,
{ "Signature Hash Algorithms Length", "ssl.handshake.sig_hash_alg_len",
FT_UINT16, BASE_DEC, NULL, 0x0,