Skip to content

Commit ed63d9a

Browse files
author
Sami Vänttinen
authored
Merge pull request #2161 from keepassxreboot/fix/passkeys_alg_string_firefox_version
Parse algorithm type as Number(). Fix required Firefox version.
2 parents dc3b0c4 + f9b9bae commit ed63d9a

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

dist/manifest_firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"applications": {
161161
"gecko": {
162162
"id": "keepassxc-browser@keepassxc.org",
163-
"strict_min_version": "67.0"
163+
"strict_min_version": "96.0"
164164
}
165165
},
166166
"default_locale": "en"

keepassxc-browser/content/passkeys-utils.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,30 @@ kpxcPasskeysUtils.buildCredentialCreationOptions = function(pkOptions, sameOrigi
7272
publicKey.authenticatorSelection = pkOptions?.authenticatorSelection;
7373
publicKey.challenge = arrayBufferToBase64(pkOptions.challenge);
7474
publicKey.extensions = pkOptions?.extensions;
75-
publicKey.pubKeyCredParams = pkOptions?.pubKeyCredParams;
75+
76+
// Make sure integers are used for "alg". Set to reserved if not found.
77+
// https://www.iana.org/assignments/cose/cose.xhtml#algorithms
78+
publicKey.pubKeyCredParams = [];
79+
if (pkOptions.pubKeyCredParams) {
80+
for (const credParam of pkOptions.pubKeyCredParams) {
81+
publicKey.pubKeyCredParams.push({
82+
type: credParam?.type,
83+
alg: credParam.alg ? Number(credParam.alg) : 0
84+
});
85+
}
86+
}
87+
7688
publicKey.rp = pkOptions?.rp;
7789
publicKey.timeout = getTimeout(publicKey?.authenticatorSelection?.userVerification, pkOptions?.timeout);
7890

7991
publicKey.excludeCredentials = [];
8092
if (pkOptions.excludeCredentials && pkOptions.excludeCredentials.length > 0) {
8193
for (const cred of pkOptions.excludeCredentials) {
82-
const arr = {
94+
publicKey.excludeCredentials.push({
8395
id: arrayBufferToBase64(cred.id),
8496
transports: cred.transports,
8597
type: cred.type
86-
};
87-
88-
publicKey.excludeCredentials.push(arr);
98+
});
8999
}
90100
}
91101

0 commit comments

Comments
 (0)