From 3449c866b2311a16bbd2138f85e0f2483da4401b Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Tue, 28 Feb 2023 15:05:56 -0800 Subject: [PATCH] scram: fix client final message The client should send r=ServerNonce rather than r=Salt Signed-off-by: Noah Watkins --- src/kpro_scram.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kpro_scram.erl b/src/kpro_scram.erl index 066d9bf..25ad709 100644 --- a/src/kpro_scram.erl +++ b/src/kpro_scram.erl @@ -67,7 +67,7 @@ parse(#{ sha := Sha <> = ServerNonce, Salt = base64:decode(Salt0), SaltedPassword = hi(Sha, Password, Salt, Iterations), - FinalNoProof = bin([?CHANNEL_BINDING, ",r=", Salt]), + FinalNoProof = bin([?CHANNEL_BINDING, ",r=", ServerNonce]), AuthMsg = [ClientFirstMsgBare, ",", ServerFirstMsg, ",", FinalNoProof], #{ sha => Sha , salted_password => SaltedPassword