1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

[EC-598] feat: fix google issues

Google does not like self-signed packed format. I've removed the attestation statement all-together untill further notice. We're don't really have any statements so
This commit is contained in:
Andreas Coroiu
2023-01-10 10:17:46 +01:00
parent 7bd7cbfd9a
commit 64f60aa870
3 changed files with 46 additions and 12 deletions

View File

@@ -6,6 +6,32 @@ import {
CredentialRegistrationResult,
} from "@bitwarden/common/abstractions/fido2/fido2.service.abstraction";
class BitAuthenticatorAttestationResponse implements AuthenticatorAttestationResponse {
clientDataJSON: ArrayBuffer;
attestationObject: ArrayBuffer;
constructor(private result: CredentialRegistrationResult) {
this.clientDataJSON = Fido2Utils.stringToBuffer(result.clientDataJSON);
this.attestationObject = Fido2Utils.stringToBuffer(result.attestationObject);
}
getAuthenticatorData(): ArrayBuffer {
return Fido2Utils.stringToBuffer(this.result.authData);
}
getPublicKey(): ArrayBuffer {
return null;
}
getPublicKeyAlgorithm(): number {
return this.result.publicKeyAlgorithm;
}
getTransports(): string[] {
return this.result.transports;
}
}
export class WebauthnUtils {
static mapCredentialCreationOptions(
options: CredentialCreationOptions,
@@ -57,12 +83,10 @@ export class WebauthnUtils {
id: result.credentialId,
rawId: Fido2Utils.stringToBuffer(result.credentialId),
type: "public-key",
response: {
clientDataJSON: Fido2Utils.stringToBuffer(result.clientDataJSON),
attestationObject: Fido2Utils.stringToBuffer(result.attestationObject),
} as AuthenticatorAttestationResponse,
authenticatorAttachment: "cross-platform",
response: new BitAuthenticatorAttestationResponse(result),
getClientExtensionResults: () => ({}),
};
} as any;
}
static mapCredentialRequestOptions(