aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/misc/snmp_usm.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2013-06-03 22:45:49 +0200
committerMicael Karlberg <[email protected]>2013-06-03 22:45:49 +0200
commit85f775093ab974128c629809e382891cb493073a (patch)
treed95058b046a1180564a2d7becf7be9d1d0b464b0 /lib/snmp/src/misc/snmp_usm.erl
parent1b7d29ce5d0f6ed4e087d9a5936834b442fd769d (diff)
parentd94474a632305049330ce578e2042b454c993abb (diff)
downloadotp-85f775093ab974128c629809e382891cb493073a.tar.gz
otp-85f775093ab974128c629809e382891cb493073a.tar.bz2
otp-85f775093ab974128c629809e382891cb493073a.zip
Merge branch 'bmk/snmp/snmp424_integration/r16' into maint
Diffstat (limited to 'lib/snmp/src/misc/snmp_usm.erl')
-rw-r--r--lib/snmp/src/misc/snmp_usm.erl25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/snmp/src/misc/snmp_usm.erl b/lib/snmp/src/misc/snmp_usm.erl
index 53c291ca0e..67e3476816 100644
--- a/lib/snmp/src/misc/snmp_usm.erl
+++ b/lib/snmp/src/misc/snmp_usm.erl
@@ -142,32 +142,33 @@ auth_out(?usmHMACSHAAuthProtocol, AuthKey, Message, UsmSecParams) ->
sha_auth_out(AuthKey, Message, UsmSecParams).
md5_auth_out(AuthKey, Message, UsmSecParams) ->
+ %% ?vtrace("md5_auth_out -> entry with"
+ %% "~n AuthKey: ~w"
+ %% "~n Message: ~w"
+ %% "~n UsmSecParams: ~w", [AuthKey, Message, UsmSecParams]),
%% 6.3.1.1
Message2 = set_msg_auth_params(Message, UsmSecParams, ?twelwe_zeros),
- Packet = snmp_pdus:enc_message_only(Message2),
+ Packet = snmp_pdus:enc_message_only(Message2),
%% 6.3.1.2-4 is done by the crypto function
%% 6.3.1.4
MAC = binary_to_list(crypto:hmac(md5, AuthKey, Packet, 12)),
- ?vtrace("md5_auth_out -> entry with"
- "~n Packet: ~w"
- "~n AuthKey: ~w"
- "~n MAC: ~w"
- , [Packet, AuthKey, MAC]),
+ %% ?vtrace("md5_auth_out -> crypto (md5) encoded"
+ %% "~n MAC: ~w", [MAC]),
%% 6.3.1.5
set_msg_auth_params(Message, UsmSecParams, MAC).
md5_auth_in(AuthKey, AuthParams, Packet) when length(AuthParams) == 12 ->
+ %% ?vtrace("md5_auth_in -> entry with"
+ %% "~n AuthKey: ~w"
+ %% "~n AuthParams: ~w"
+ %% "~n Packet: ~w", [AuthKey, AuthParams, Packet]),
%% 6.3.2.3
Packet2 = patch_packet(binary_to_list(Packet)),
%% 6.3.2.5
MAC = binary_to_list(crypto:hmac(md5, AuthKey, Packet2, 12)),
%% 6.3.2.6
- ?vtrace("md5_auth_in -> entry with"
- "~n Packet2: ~w"
- "~n AuthKey: ~w"
- "~n AuthParams: ~w"
- "~n MAC: ~w"
- , [Packet2, AuthKey, AuthParams, MAC]),
+ %% ?vtrace("md5_auth_in -> crypto (md5) encoded"
+ %% "~n MAC: ~w", [MAC]),
MAC == AuthParams;
md5_auth_in(_AuthKey, _AuthParams, _Packet) ->
%% 6.3.2.1