Commit 1dce8af
committed
fix(web-demo): pad base64url before atob in toArrayBuffer
passkey-crypto stores PRF salts and credential IDs as canonical
base64url (no padding). atob requires the input length to be a multiple
of 4 — without the padding it silently drops the trailing partial group
and the PRF extension receives a salt that's missing its last byte. That
bad salt produces a different PRF output, the derived password no
longer matches what attachPasskeyToWallet stored, and decryption fails
with ccm tag mismatch.
Pad with '=' up to the next multiple of 4 before atob.
Refs: WCN-194
TICKET: WCN-1941 parent 4b30c68 commit 1dce8af
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
| |||
0 commit comments