mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add getPublicKeyAlgorithm() to create attestation response
This commit is contained in:
parent
72832c1a5b
commit
179d64e40b
1 changed files with 4 additions and 0 deletions
|
|
@ -22,6 +22,9 @@ const stringToArrayBuffer = function(str) {
|
||||||
|
|
||||||
// From URL encoded base64 string to ArrayBuffer
|
// From URL encoded base64 string to ArrayBuffer
|
||||||
const base64ToArrayBuffer = function(str) {
|
const base64ToArrayBuffer = function(str) {
|
||||||
|
if (!str) {
|
||||||
|
return new ArrayBuffer();
|
||||||
|
}
|
||||||
return stringToArrayBuffer(window.atob(str?.replaceAll('-', '+').replaceAll('_', '/')));
|
return stringToArrayBuffer(window.atob(str?.replaceAll('-', '+').replaceAll('_', '/')));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -31,6 +34,7 @@ const createAttestationResponse = function(publicKey) {
|
||||||
attestationObject: base64ToArrayBuffer(publicKey.response.attestationObject),
|
attestationObject: base64ToArrayBuffer(publicKey.response.attestationObject),
|
||||||
clientDataJSON: base64ToArrayBuffer(publicKey.response.clientDataJSON),
|
clientDataJSON: base64ToArrayBuffer(publicKey.response.clientDataJSON),
|
||||||
getAuthenticatorData: () => base64ToArrayBuffer(publicKey.response?.authenticatorData),
|
getAuthenticatorData: () => base64ToArrayBuffer(publicKey.response?.authenticatorData),
|
||||||
|
getPublicKeyAlgorithm: () => publicKey.response?.publicKeyAlgorithm,
|
||||||
getTransports: () => [ 'internal' ]
|
getTransports: () => [ 'internal' ]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue