We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbf35b8 commit b5e9cf8Copy full SHA for b5e9cf8
lib/mongo/auth/scram.ex
@@ -75,16 +75,16 @@ defmodule Mongo.Auth.SCRAM do
75
end
76
77
defp generate_proof(salted_password, auth_message, digest) do
78
- client_key = :crypto.hmac(digest, salted_password, "Client Key")
+ client_key = :crypto.mac(:hmac, digest, salted_password, "Client Key")
79
stored_key = :crypto.hash(digest, client_key)
80
- signature = :crypto.hmac(digest, stored_key, auth_message)
+ signature = :crypto.mac(:hmac, digest, stored_key, auth_message)
81
client_proof = xor_keys(client_key, signature, "")
82
"p=#{Base.encode64(client_proof)}"
83
84
85
defp generate_signature(salted_password, auth_message, digest) do
86
- server_key = :crypto.hmac(digest, salted_password, "Server Key")
87
- :crypto.hmac(digest, server_key, auth_message)
+ server_key = :crypto.mac(:hmac, digest, salted_password, "Server Key")
+ :crypto.mac(:hmac, digest, server_key, auth_message)
88
89
90
defp xor_keys("", "", result), do: result
0 commit comments