mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Removed deprecated calls to crypto:sha_mac in scram.erl
This commit is contained in:
parent
f6db84282b
commit
5135e30633
@ -41,7 +41,7 @@ salted_password(Password, Salt, IterationCount) ->
|
||||
-spec client_key(binary()) -> binary().
|
||||
|
||||
client_key(SaltedPassword) ->
|
||||
crypto:sha_mac(SaltedPassword, <<"Client Key">>).
|
||||
sha_mac(SaltedPassword, <<"Client Key">>).
|
||||
|
||||
-spec stored_key(binary()) -> binary().
|
||||
|
||||
@ -50,12 +50,12 @@ stored_key(ClientKey) -> p1_sha:sha1(ClientKey).
|
||||
-spec server_key(binary()) -> binary().
|
||||
|
||||
server_key(SaltedPassword) ->
|
||||
crypto:sha_mac(SaltedPassword, <<"Server Key">>).
|
||||
sha_mac(SaltedPassword, <<"Server Key">>).
|
||||
|
||||
-spec client_signature(binary(), binary()) -> binary().
|
||||
|
||||
client_signature(StoredKey, AuthMessage) ->
|
||||
crypto:sha_mac(StoredKey, AuthMessage).
|
||||
sha_mac(StoredKey, AuthMessage).
|
||||
|
||||
-spec client_key(binary(), binary()) -> binary().
|
||||
|
||||
@ -67,20 +67,23 @@ client_key(ClientProof, ClientSignature) ->
|
||||
-spec server_signature(binary(), binary()) -> binary().
|
||||
|
||||
server_signature(ServerKey, AuthMessage) ->
|
||||
crypto:sha_mac(ServerKey, AuthMessage).
|
||||
sha_mac(ServerKey, AuthMessage).
|
||||
|
||||
hi(Password, Salt, IterationCount) ->
|
||||
U1 = crypto:sha_mac(Password, <<Salt/binary, 0, 0, 0, 1>>),
|
||||
U1 = sha_mac(Password, <<Salt/binary, 0, 0, 0, 1>>),
|
||||
list_to_binary(lists:zipwith(fun (X, Y) -> X bxor Y end,
|
||||
binary_to_list(U1),
|
||||
binary_to_list(hi_round(Password, U1,
|
||||
IterationCount - 1)))).
|
||||
|
||||
hi_round(Password, UPrev, 1) ->
|
||||
crypto:sha_mac(Password, UPrev);
|
||||
sha_mac(Password, UPrev);
|
||||
hi_round(Password, UPrev, IterationCount) ->
|
||||
U = crypto:sha_mac(Password, UPrev),
|
||||
U = sha_mac(Password, UPrev),
|
||||
list_to_binary(lists:zipwith(fun (X, Y) -> X bxor Y end,
|
||||
binary_to_list(U),
|
||||
binary_to_list(hi_round(Password, U,
|
||||
IterationCount - 1)))).
|
||||
|
||||
sha_mac(Key, Data) ->
|
||||
crypto:hmac(sha, Key, Data).
|
||||
|
Loading…
Reference in New Issue
Block a user