Skip to content

Commit

Permalink
[WebAuthn] Do not end ceremony if plugged in U2F cannot fulfill the r…
Browse files Browse the repository at this point in the history
…equest.

https://bugs.webkit.org/show_bug.cgi?id=259662
rdar://112477660

Reviewed by Brent Fulgham.

These responses cause ceremonies to error out whenever an unsupported for the
operation U2F key is plugged in. We shouldn't end the ceremony just because
the plugged in U2F key is plugged in because the user could still plug in a different
key or use the platform authenticator.

* Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
(WebKit::U2fAuthenticator::makeCredential):
(WebKit::U2fAuthenticator::getAssertion):

Canonical link: https://commits.webkit.org/266658@main
  • Loading branch information
pascoej authored and johnwilander committed Aug 7, 2023
1 parent 15c863e commit b9ff70d
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ U2fAuthenticator::U2fAuthenticator(std::unique_ptr<CtapDriver>&& driver)
void U2fAuthenticator::makeCredential()
{
auto& creationOptions = std::get<PublicKeyCredentialCreationOptions>(requestData().options);
if (!isConvertibleToU2fRegisterCommand(creationOptions)) {
receiveRespond(ExceptionData { NotSupportedError, "Cannot convert the request to U2F command."_s });
if (!isConvertibleToU2fRegisterCommand(creationOptions))
return;
}
if (!creationOptions.excludeCredentials.isEmpty()) {
ASSERT(!m_nextListIndex);
checkExcludeList(m_nextListIndex++);
Expand Down Expand Up @@ -87,10 +85,8 @@ void U2fAuthenticator::issueRegisterCommand()

void U2fAuthenticator::getAssertion()
{
if (!isConvertibleToU2fSignCommand(std::get<PublicKeyCredentialRequestOptions>(requestData().options))) {
receiveRespond(ExceptionData { NotSupportedError, "Cannot convert the request to U2F command."_s });
if (!isConvertibleToU2fSignCommand(std::get<PublicKeyCredentialRequestOptions>(requestData().options)))
return;
}
ASSERT(!m_nextListIndex);
issueSignCommand(m_nextListIndex++);
}
Expand Down

0 comments on commit b9ff70d

Please sign in to comment.