Skip to content

Commit

Permalink
Change WebAuthn create challenge to 16 random bytes (#2561)
Browse files Browse the repository at this point in the history
According to the WebAuthn spec the challenge _should_ be at
least 16 bytes. So far it was 9. Apparently, KeePassXC verifies
the challenge length and refuses to sign shorter values.

This changes the length to 16 bytes which should address the problem.

Closes #2560.
  • Loading branch information
frederikrothenberger authored Aug 20, 2024
1 parent 09c024c commit 8d29992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/src/utils/iiConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ export const creationOptions = (
type: "public-key",
}
),
challenge: Uint8Array.from("<ic0.app>", (c) => c.charCodeAt(0)),
challenge: window.crypto.getRandomValues(new Uint8Array(16)),
pubKeyCredParams: [
{
type: "public-key",
Expand Down

0 comments on commit 8d29992

Please sign in to comment.