Parse algorithm type as Number(). Fix required Firefox version.

This commit is contained in:
varjolintu 2024-03-30 08:10:27 +02:00
parent dc3b0c495e
commit f9b9bae410
2 changed files with 16 additions and 6 deletions

View file

@ -160,7 +160,7 @@
"applications": {
"gecko": {
"id": "keepassxc-browser@keepassxc.org",
"strict_min_version": "67.0"
"strict_min_version": "96.0"
}
},
"default_locale": "en"

View file

@ -72,20 +72,30 @@ kpxcPasskeysUtils.buildCredentialCreationOptions = function(pkOptions, sameOrigi
publicKey.authenticatorSelection = pkOptions?.authenticatorSelection;
publicKey.challenge = arrayBufferToBase64(pkOptions.challenge);
publicKey.extensions = pkOptions?.extensions;
publicKey.pubKeyCredParams = pkOptions?.pubKeyCredParams;
// Make sure integers are used for "alg". Set to reserved if not found.
// https://www.iana.org/assignments/cose/cose.xhtml#algorithms
publicKey.pubKeyCredParams = [];
if (pkOptions.pubKeyCredParams) {
for (const credParam of pkOptions.pubKeyCredParams) {
publicKey.pubKeyCredParams.push({
type: credParam?.type,
alg: credParam.alg ? Number(credParam.alg) : 0
});
}
}
publicKey.rp = pkOptions?.rp;
publicKey.timeout = getTimeout(publicKey?.authenticatorSelection?.userVerification, pkOptions?.timeout);
publicKey.excludeCredentials = [];
if (pkOptions.excludeCredentials && pkOptions.excludeCredentials.length > 0) {
for (const cred of pkOptions.excludeCredentials) {
const arr = {
publicKey.excludeCredentials.push({
id: arrayBufferToBase64(cred.id),
transports: cred.transports,
type: cred.type
};
publicKey.excludeCredentials.push(arr);
});
}
}