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.


(cherry picked from commit 7f376c7ced)
This commit is contained in:
j.novak@netsystem.cz 2020-12-13 15:28:36 +00:00 committed by Pascal Quantin
parent a16388824b
commit c865975463
2 changed files with 3 additions and 5 deletions

View File

@ -201,8 +201,7 @@ BulkPDU/request-id bulkPDU_request-id
#.FN_FTR SNMPv3Message
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);

View File

@ -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);