summaryrefslogtreecommitdiff
path: root/epan
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 11:11:17 +0000
commit2e04336cdc0dca5937d5193d850172939a317f29 (patch)
treeffa682a59c1b45b0a29e8b6c4e86f31b18a96532 /epan
parent298012359b52a9bf1ca22e0d1bedf23ec3e7680f (diff)
downloadwireshark-2e04336cdc0dca5937d5193d850172939a317f29.tar.gz
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>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-snmp.c8
1 files changed, 5 insertions, 3 deletions
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