aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-02-26 12:03:25 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2016-02-26 12:45:49 +0000
commitf30a29e53e931563c7ca871297a5acbdc109770b (patch)
tree9698dc65d528786f32055df37e7039a5210539bf
parent8f7a26e8fcf878bb55601edae5032caf71c2e587 (diff)
downloadwireshark-f30a29e53e931563c7ca871297a5acbdc109770b.tar.gz
wireshark-f30a29e53e931563c7ca871297a5acbdc109770b.tar.bz2
wireshark-f30a29e53e931563c7ca871297a5acbdc109770b.zip
snmp: Decode msgSecurityParameters ASN.1 header
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 <stig@bjorlykke.org> Reviewed-on: https://code.wireshark.org/review/14161
-rw-r--r--asn1/snmp/snmp.cnf4
-rw-r--r--epan/dissectors/packet-snmp.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf
index f30b6c1464..5c45db4738 100644
--- a/asn1/snmp/snmp.cnf
+++ b/asn1/snmp/snmp.cnf
@@ -164,7 +164,9 @@ gint pdu_type=-1;
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 */
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index b4fd39ea19..3f2d8bc8cc 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -2545,7 +2545,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 */