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:
@@ -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)),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user