From 7f376c7ced445c6373098b8f7f8790a78822fe0a Mon Sep 17 00:00:00 2001 From: "j.novak@netsystem.cz" Date: Sun, 13 Dec 2020 15:28:36 +0000 Subject: SNMP: Fix checking of SNMP v3 auth if MD5 method is used When the user enters row to SNMP Users table in wireshark and Authentication model is set to MD5, row is ignored in processing. The reason is that constant for MD5 is 0, but the code checks if the value is defined by simple 'usm_p.user_assoc' condition. Therefore 0 never succeeds. As item can have only listed values, I think the check can be removed. Function verified on sample. I propose to cherry pick the change to all stable branches. --- epan/dissectors/packet-snmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-snmp.c') diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 6dbc9c65e1..6d67562f94 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -2664,7 +2664,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 239 "./asn1/snmp/snmp.cnf" +#line 238 "./asn1/snmp/snmp.cnf" tvbuff_t *parameter_tvb = NULL; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -2849,8 +2849,7 @@ dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off #line 202 "./asn1/snmp/snmp.cnf" if( usm_p.authenticated - && usm_p.user_assoc - && usm_p.user_assoc->user.authModel ) { + && usm_p.user_assoc ) { const gchar* error = NULL; proto_item* authen_item; proto_tree* authen_tree = proto_item_add_subtree(usm_p.auth_item,ett_authParameters); -- cgit v1.2.3