Skip to content

Commit

Permalink
fix: SASL signature consists of the string representation of the payl…
Browse files Browse the repository at this point in the history
…oad (#2529)

`payload.value()` already returns the correct string representation
  • Loading branch information
marcj authored Dec 10, 2020
1 parent cb9ee9e commit e7d2693
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/cmap/auth/scram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,9 @@ function continueScramConversation(
const clientKey = HMAC(cryptoMethod, saltedPassword, 'Client Key');
const serverKey = HMAC(cryptoMethod, saltedPassword, 'Server Key');
const storedKey = H(cryptoMethod, clientKey);
const authMessage = [
clientFirstMessageBare(username, nonce),
payload.value().toString('base64'),
withoutProof
].join(',');
const authMessage = [clientFirstMessageBare(username, nonce), payload.value(), withoutProof].join(
','
);

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

0 comments on commit e7d2693

Please sign in to comment.