Skip to content

Commit

Permalink
fix: SASL's signature consists of the string representation of the pa…
Browse files Browse the repository at this point in the history
…yload, not base64

`payload.value()` already returns a string, so calling on it `toString('base64')`
implies the signature consists of a base64 representation, but the plain string is required.
The first argument ('base64') of String.toString is dropped, so although the code works
as expected (by accident) it implies that it was desired to have a base64 there, which is wrong.

Dropped the toString() call to not confuse driver authors when they want to get inspiration
from this JS driver.
  • Loading branch information
marcj committed Aug 25, 2020
1 parent f7094b2 commit 107afb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmap/auth/scram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function continueScramConversation(
const storedKey = H(cryptoMethod, clientKey);
const authMessage = [
clientFirstMessageBare(username, nonce),
payload.value().toString('base64'),
payload.value(),
withoutProof
].join(',');

Expand Down

0 comments on commit 107afb3

Please sign in to comment.