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 <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Eugene Adell 2018-05-20 03:57:42 -07:00 committed by Peter Wu
parent bf8590326a
commit 9b92d825cb
1 changed files with 5 additions and 5 deletions

View File

@ -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);
}