Prevent Illegal Invokcation on getPublicKey/getPublicKeyAlgorithm (#2323)

Prevent Illegal Invocation on getPublicKey/getPublicKeyAlgorithm
This commit is contained in:
Kirill Poletaev 2024-10-05 08:51:09 +03:00 committed by GitHub
parent 5efa5155a7
commit 928ed65e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,10 +31,11 @@ const createAttestationResponse = function(publicKey) {
attestationObject: kpxcBase64ToArrayBuffer(publicKey.response.attestationObject),
clientDataJSON: kpxcBase64ToArrayBuffer(publicKey.response.clientDataJSON),
getAuthenticatorData: () => kpxcBase64ToArrayBuffer(publicKey.response?.authenticatorData),
getPublicKey: () => null,
getPublicKeyAlgorithm: () => publicKey.response?.publicKeyAlgorithm,
getTransports: () => [ 'internal' ]
};
return Object.setPrototypeOf(response, AuthenticatorAttestationResponse.prototype);
return Object.setPrototypeOf(response, AuthenticatorAttestationResponse.prototype);
};
// Wraps response to AuthenticatorAssertionResponse object