mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-05 01:15:33 -05:00
Passkeys: Do not ask update with a new user handle
This commit is contained in:
parent
9329df2b48
commit
8a4787278d
@ -633,12 +633,15 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public
|
|||||||
const auto rpId = publicKeyOptions["rp"]["id"].toString();
|
const auto rpId = publicKeyOptions["rp"]["id"].toString();
|
||||||
const auto timeout = publicKeyOptions["timeout"].toInt();
|
const auto timeout = publicKeyOptions["timeout"].toInt();
|
||||||
const auto username = credentialCreationOptions["user"].toObject()["name"].toString();
|
const auto username = credentialCreationOptions["user"].toObject()["name"].toString();
|
||||||
|
const auto user = credentialCreationOptions["user"].toObject();
|
||||||
|
const auto userId = user["id"].toString();
|
||||||
|
|
||||||
// Parse excludeCredentialDescriptorList
|
// Parse excludeCredentialDescriptorList
|
||||||
if (!excludeCredentials.isEmpty() && isPasskeyCredentialExcluded(excludeCredentials, rpId, keyList)) {
|
if (!excludeCredentials.isEmpty() && isPasskeyCredentialExcluded(excludeCredentials, rpId, keyList)) {
|
||||||
return getPasskeyError(ERROR_PASSKEYS_CREDENTIAL_IS_EXCLUDED);
|
return getPasskeyError(ERROR_PASSKEYS_CREDENTIAL_IS_EXCLUDED);
|
||||||
}
|
}
|
||||||
const auto existingEntries = getPasskeyEntries(rpId, keyList);
|
|
||||||
|
const auto existingEntries = getPasskeyEntriesWithUserHandle(rpId, userId, keyList);
|
||||||
|
|
||||||
raiseWindow();
|
raiseWindow();
|
||||||
BrowserPasskeysConfirmationDialog confirmDialog;
|
BrowserPasskeysConfirmationDialog confirmDialog;
|
||||||
@ -654,9 +657,6 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto rpName = publicKeyOptions["rp"]["name"].toString();
|
const auto rpName = publicKeyOptions["rp"]["name"].toString();
|
||||||
const auto user = credentialCreationOptions["user"].toObject();
|
|
||||||
const auto userId = user["id"].toString();
|
|
||||||
|
|
||||||
if (confirmDialog.isPasskeyUpdated()) {
|
if (confirmDialog.isPasskeyUpdated()) {
|
||||||
addPasskeyToEntry(confirmDialog.getSelectedEntry(),
|
addPasskeyToEntry(confirmDialog.getSelectedEntry(),
|
||||||
rpId,
|
rpId,
|
||||||
@ -1347,6 +1347,22 @@ QList<Entry*> BrowserService::getPasskeyEntries(const QString& rpId, const Strin
|
|||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns all Passkey entries for the current Relying Party and identical user handle
|
||||||
|
QList<Entry*> BrowserService::getPasskeyEntriesWithUserHandle(const QString& rpId,
|
||||||
|
const QString& userId,
|
||||||
|
const StringPairList& keyList)
|
||||||
|
{
|
||||||
|
QList<Entry*> entries;
|
||||||
|
for (const auto& entry : searchEntries(rpId, "", keyList, true)) {
|
||||||
|
if (entry->hasPasskey() && entry->attributes()->value(BrowserPasskeys::KPEX_PASSKEY_RELYING_PARTY) == rpId
|
||||||
|
&& entry->attributes()->value(BrowserPasskeys::KPEX_PASSKEY_USER_HANDLE) == userId) {
|
||||||
|
entries << entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
// Get all entries for the site that are allowed by the server
|
// Get all entries for the site that are allowed by the server
|
||||||
QList<Entry*> BrowserService::getPasskeyAllowedEntries(const QJsonObject& assertionOptions,
|
QList<Entry*> BrowserService::getPasskeyAllowedEntries(const QJsonObject& assertionOptions,
|
||||||
const QString& rpId,
|
const QString& rpId,
|
||||||
|
@ -184,6 +184,8 @@ private:
|
|||||||
#ifdef WITH_XC_BROWSER_PASSKEYS
|
#ifdef WITH_XC_BROWSER_PASSKEYS
|
||||||
QList<Entry*> getPasskeyEntries(const QString& rpId, const StringPairList& keyList);
|
QList<Entry*> getPasskeyEntries(const QString& rpId, const StringPairList& keyList);
|
||||||
QList<Entry*>
|
QList<Entry*>
|
||||||
|
getPasskeyEntriesWithUserHandle(const QString& rpId, const QString& userId, const StringPairList& keyList);
|
||||||
|
QList<Entry*>
|
||||||
getPasskeyAllowedEntries(const QJsonObject& assertionOptions, const QString& rpId, const StringPairList& keyList);
|
getPasskeyAllowedEntries(const QJsonObject& assertionOptions, const QString& rpId, const StringPairList& keyList);
|
||||||
bool isPasskeyCredentialExcluded(const QJsonArray& excludeCredentials,
|
bool isPasskeyCredentialExcluded(const QJsonArray& excludeCredentials,
|
||||||
const QString& rpId,
|
const QString& rpId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user