Skip to content

Commit e7d2693

Browse files
authored
fix: SASL signature consists of the string representation of the payload (#2529)
`payload.value()` already returns the correct string representation
1 parent cb9ee9e commit e7d2693

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/cmap/auth/scram.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,9 @@ function continueScramConversation(
183183
const clientKey = HMAC(cryptoMethod, saltedPassword, 'Client Key');
184184
const serverKey = HMAC(cryptoMethod, saltedPassword, 'Server Key');
185185
const storedKey = H(cryptoMethod, clientKey);
186-
const authMessage = [
187-
clientFirstMessageBare(username, nonce),
188-
payload.value().toString('base64'),
189-
withoutProof
190-
].join(',');
186+
const authMessage = [clientFirstMessageBare(username, nonce), payload.value(), withoutProof].join(
187+
','
188+
);
191189

192190
const clientSignature = HMAC(cryptoMethod, storedKey, authMessage);
193191
const clientProof = `p=${xor(clientKey, clientSignature)}`;

0 commit comments

Comments
 (0)