aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-snmp.c
diff options
context:
space:
mode:
authorj.novak@netsystem.cz <j.novak@netsystem.cz>2020-12-13 15:28:36 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2020-12-13 15:28:36 +0000
commit7f376c7ced445c6373098b8f7f8790a78822fe0a (patch)
treef43111fb041a5d2691a8d3fa246a0e88d0d406cd /epan/dissectors/packet-snmp.c
parent9d2481c9f53ccb86a916dbb434b2c4114653984b (diff)
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.
Diffstat (limited to 'epan/dissectors/packet-snmp.c')
-rw-r--r--epan/dissectors/packet-snmp.c5
1 files changed, 2 insertions, 3 deletions
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);