Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passkeys: Allow nfc and usb transports #10402

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/browser/BrowserPasskeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const QString BrowserPasskeys::AAGUID = QStringLiteral("fdb141b25d84443e8a354698
// Authenticator capabilities
const QString BrowserPasskeys::ATTACHMENT_CROSS_PLATFORM = QStringLiteral("cross-platform");
const QString BrowserPasskeys::ATTACHMENT_PLATFORM = QStringLiteral("platform");
const QString BrowserPasskeys::AUTHENTICATOR_TRANSPORT = QStringLiteral("internal");
const QString BrowserPasskeys::AUTHENTICATOR_TRANSPORT_INTERNAL = QStringLiteral("internal");
const QString BrowserPasskeys::AUTHENTICATOR_TRANSPORT_NFC = QStringLiteral("nfc");
const QString BrowserPasskeys::AUTHENTICATOR_TRANSPORT_USB = QStringLiteral("usb");
const bool BrowserPasskeys::SUPPORT_RESIDENT_KEYS = true;
const bool BrowserPasskeys::SUPPORT_USER_VERIFICATION = true;

Expand Down
4 changes: 3 additions & 1 deletion src/browser/BrowserPasskeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ class BrowserPasskeys : public QObject

static const QString ATTACHMENT_CROSS_PLATFORM;
static const QString ATTACHMENT_PLATFORM;
static const QString AUTHENTICATOR_TRANSPORT;
static const QString AUTHENTICATOR_TRANSPORT_INTERNAL;
static const QString AUTHENTICATOR_TRANSPORT_NFC;
static const QString AUTHENTICATOR_TRANSPORT_USB;
static const bool SUPPORT_RESIDENT_KEYS;
static const bool SUPPORT_USER_VERIFICATION;

Expand Down
6 changes: 4 additions & 2 deletions src/browser/PasskeyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ QStringList PasskeyUtils::getAllowedCredentialsFromAssertionOptions(const QJsonO
const auto cred = credential.toObject();
const auto id = cred["id"].toString();
const auto transports = cred["transports"].toArray();
const auto hasSupportedTransport =
transports.isEmpty() || transports.contains(BrowserPasskeys::AUTHENTICATOR_TRANSPORT);
const auto hasSupportedTransport = transports.isEmpty()
|| (transports.contains(BrowserPasskeys::AUTHENTICATOR_TRANSPORT_INTERNAL)
|| transports.contains(BrowserPasskeys::AUTHENTICATOR_TRANSPORT_NFC)
|| transports.contains(BrowserPasskeys::AUTHENTICATOR_TRANSPORT_USB));

if (cred["type"].toString() == BrowserPasskeys::PUBLIC_KEY && hasSupportedTransport && !id.isEmpty()) {
allowedCredentials << id;
Expand Down
Loading