1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-18809] Passkey: use ArrayBuffer instead of Uint8Array (#15092)

* Passkey: use ArrayBuffer instead of Uint8Array to conform WebAuthn spec

* ArrayBufferView generics was too modern for this project

* Correctly update the types from Uint8arrays to ArrayBuffers

* Fixed broken tests + bugs

* Removed arrayBufferViewToArrayBuffer as it's not needed in this invocation paths

---------

Co-authored-by: ozraru <ozraru@raru.work>
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
This commit is contained in:
Anders Åberg
2025-07-01 21:00:13 +02:00
committed by GitHub
parent c9aa8498c7
commit 5eca3a5916
7 changed files with 26 additions and 23 deletions

View File

@@ -209,7 +209,7 @@ export class DesktopAutofillService implements OnDestroy {
}
request.credentialId = Array.from(
parseCredentialId(decrypted.login.fido2Credentials?.[0].credentialId),
new Uint8Array(parseCredentialId(decrypted.login.fido2Credentials?.[0].credentialId)),
);
}
@@ -336,12 +336,12 @@ export class DesktopAutofillService implements OnDestroy {
response: Fido2AuthenticatorGetAssertionResult,
): autofill.PasskeyAssertionResponse {
return {
userHandle: Array.from(response.selectedCredential.userHandle),
userHandle: Array.from(new Uint8Array(response.selectedCredential.userHandle)),
rpId: request.rpId,
signature: Array.from(response.signature),
signature: Array.from(new Uint8Array(response.signature)),
clientDataHash: request.clientDataHash,
authenticatorData: Array.from(response.authenticatorData),
credentialId: Array.from(response.selectedCredential.id),
authenticatorData: Array.from(new Uint8Array(response.authenticatorData)),
credentialId: Array.from(new Uint8Array(response.selectedCredential.id)),
};
}