From 9b92d825cba5c4d56698cccddfe1d6d570c95e87 Mon Sep 17 00:00:00 2001 From: Eugene Adell Date: Sun, 20 May 2018 03:57:42 -0700 Subject: [PATCH] SSL: Send the record_length to the dissect_ssl3_alert and use it Bug: 14712 Change-Id: I3550f0da76a9acd3619d243b5a6e1d04d6734b62 Reviewed-on: https://code.wireshark.org/review/27670 Petri-Dish: Alexis La Goutte Reviewed-by: Peter Wu --- epan/dissectors/packet-ssl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index c8322ebb27..1714063938 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -543,7 +543,7 @@ static gint dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo, /* alert message dissector */ static void dissect_ssl3_alert(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, - const SslSession *session); + guint32 record_length, const SslSession *session); /* handshake protocol dissector */ static void dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo, @@ -1956,9 +1956,9 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo, break; case SSL_ID_ALERT: if (decrypted) { - dissect_ssl3_alert(decrypted, pinfo, ssl_record_tree, 0, session); + dissect_ssl3_alert(decrypted, pinfo, ssl_record_tree, 0, 2, session); } else { - dissect_ssl3_alert(tvb, pinfo, ssl_record_tree, offset, session); + dissect_ssl3_alert(tvb, pinfo, ssl_record_tree, offset, record_length, session); } break; case SSL_ID_HANDSHAKE: @@ -2044,7 +2044,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo, /* dissects the alert message, filling in the tree */ static void dissect_ssl3_alert(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, guint32 offset, + proto_tree *tree, guint32 offset, guint32 record_length, const SslSession *session) { /* struct { @@ -2062,7 +2062,7 @@ dissect_ssl3_alert(tvbuff_t *tvb, packet_info *pinfo, if (tree) { ti = proto_tree_add_item(tree, hf_ssl_alert_message, tvb, - offset, 2, ENC_NA); + offset, record_length, ENC_NA); ssl_alert_tree = proto_item_add_subtree(ti, ett_ssl_alert); }