From 2e04336cdc0dca5937d5193d850172939a317f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Fri, 26 Feb 2016 12:03:25 +0100 Subject: snmp: Decode msgSecurityParameters ASN.1 header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decode ASN.1 identifier and length to get correct offset to msgSecurityParameters. Bug: 12181 Change-Id: Icf83616ac0a63e1d48652738942fe339dd165cab Reviewed-on: https://code.wireshark.org/review/14158 Reviewed-by: Stig Bjørlykke --- epan/dissectors/packet-snmp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'epan') diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 1673fbc76f..899d24369d 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -2582,7 +2582,7 @@ dissect_snmp_INTEGER_484_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_ static int dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 217 "../../asn1/snmp/snmp.cnf" +#line 219 "../../asn1/snmp/snmp.cnf" tvbuff_t *parameter_tvb = NULL; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -2641,7 +2641,9 @@ dissect_snmp_T_msgSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U switch(MsgSecurityModel){ case SNMP_SEC_USM: /* 3 */ - offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, actx, tree, -1); + offset = get_ber_identifier(tvb, offset, NULL, NULL, NULL); + offset = get_ber_length(tvb, offset, NULL, NULL); + offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset, actx, tree, -1); usm_p.user_assoc = get_user_assoc(usm_p.engine_tvb, usm_p.user_tvb); break; case SNMP_SEC_ANY: /* 0 */ @@ -2762,7 +2764,7 @@ dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SNMPv3Message_sequence, hf_index, ett_snmp_SNMPv3Message); -#line 180 "../../asn1/snmp/snmp.cnf" +#line 182 "../../asn1/snmp/snmp.cnf" if( usm_p.authenticated && usm_p.user_assoc -- cgit v1.2.1