Changeset 256001 in webkit


Ignore:
Timestamp:
Feb 6, 2020 6:57:30 PM (4 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] authenticatorGetAssertion should be sent without pinAuth if UV = "discouraged"
https://bugs.webkit.org/show_bug.cgi?id=206547
<rdar://problem/58768032>

Reviewed by Brent Fulgham.

Source/WebKit:

Covered by new tests within existing files.

  • UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:

(WebKit::CtapAuthenticator::makeCredential):
(WebKit::CtapAuthenticator::getAssertion):

LayoutTests:

  • http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt:
  • http/wpt/webauthn/public-key-credential-get-success-hid.https.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r255996 r256001  
     12020-02-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] authenticatorGetAssertion should be sent without pinAuth if UV = "discouraged"
     4        https://bugs.webkit.org/show_bug.cgi?id=206547
     5        <rdar://problem/58768032>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt:
     10        * http/wpt/webauthn/public-key-credential-get-success-hid.https.html:
     11
    1122020-02-06  Antti Koivisto  <antti@apple.com>
    213
  • trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt

    r254356 r256001  
    77PASS PublicKeyCredential's [[get]] with two consecutive requests.
    88PASS PublicKeyCredential's [[get]] with multiple accounts in a mock hid authenticator.
     9PASS PublicKeyCredential's [[get]] with PIN supported in the authenticator but userVerification = 'discouraged' in a mock hid authenticator.
    910
  • trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https.html

    r254356 r256001  
    117117        });
    118118    }, "PublicKeyCredential's [[get]] with multiple accounts in a mock hid authenticator.");
     119
     120    promise_test(t => {
     121        const options = {
     122            publicKey: {
     123                challenge: Base64URL.parse("MTIzNDU2"),
     124                userVerification: "discouraged",
     125                timeout: 100
     126            }
     127        };
     128
     129        if (window.internals)
     130            internals.setMockWebAuthenticationConfiguration({ hid: { supportClientPin: true, payloadBase64: [testAssertionMessageBase64] } });
     131        return navigator.credentials.get(options).then(credential => {
     132            return checkCtapGetAssertionResult(credential);
     133        });
     134    }, "PublicKeyCredential's [[get]] with PIN supported in the authenticator but userVerification = 'discouraged' in a mock hid authenticator.");
    119135</script>
  • trunk/Source/WebKit/ChangeLog

    r256000 r256001  
     12020-02-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] authenticatorGetAssertion should be sent without pinAuth if UV = "discouraged"
     4        https://bugs.webkit.org/show_bug.cgi?id=206547
     5        <rdar://problem/58768032>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Covered by new tests within existing files.
     10
     11        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
     12        (WebKit::CtapAuthenticator::makeCredential):
     13        (WebKit::CtapAuthenticator::getAssertion):
     14
    1152020-02-06  Wenson Hsieh  <wenson_hsieh@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp

    r254554 r256001  
    5959        return;
    6060    Vector<uint8_t> cborCmd;
     61    auto& options = WTF::get<PublicKeyCredentialCreationOptions>(requestData().options);
    6162    if (m_info.options().clientPinAvailability() == AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet)
    62         cborCmd = encodeMakeCredenitalRequestAsCBOR(requestData().hash, WTF::get<PublicKeyCredentialCreationOptions>(requestData().options), m_info.options().userVerificationAvailability(), PinParameters { pin::kProtocolVersion, m_pinAuth });
     63        cborCmd = encodeMakeCredenitalRequestAsCBOR(requestData().hash, options, m_info.options().userVerificationAvailability(), PinParameters { pin::kProtocolVersion, m_pinAuth });
    6364    else
    64         cborCmd = encodeMakeCredenitalRequestAsCBOR(requestData().hash, WTF::get<PublicKeyCredentialCreationOptions>(requestData().options), m_info.options().userVerificationAvailability());
     65        cborCmd = encodeMakeCredenitalRequestAsCBOR(requestData().hash, options, m_info.options().userVerificationAvailability());
    6566    driver().transact(WTFMove(cborCmd), [weakThis = makeWeakPtr(*this)](Vector<uint8_t>&& data) {
    6667        ASSERT(RunLoop::isMain());
     
    9293    ASSERT(!m_isDowngraded);
    9394    Vector<uint8_t> cborCmd;
    94     if (m_info.options().clientPinAvailability() == AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet)
    95         cborCmd = encodeGetAssertionRequestAsCBOR(requestData().hash, WTF::get<PublicKeyCredentialRequestOptions>(requestData().options), m_info.options().userVerificationAvailability(), PinParameters { pin::kProtocolVersion, m_pinAuth });
     95    auto& options = WTF::get<PublicKeyCredentialRequestOptions>(requestData().options);
     96    if (m_info.options().clientPinAvailability() == AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet && options.userVerification != UserVerificationRequirement::Discouraged)
     97        cborCmd = encodeGetAssertionRequestAsCBOR(requestData().hash, options, m_info.options().userVerificationAvailability(), PinParameters { pin::kProtocolVersion, m_pinAuth });
    9698    else
    97         cborCmd = encodeGetAssertionRequestAsCBOR(requestData().hash, WTF::get<PublicKeyCredentialRequestOptions>(requestData().options), m_info.options().userVerificationAvailability());
     99        cborCmd = encodeGetAssertionRequestAsCBOR(requestData().hash, options, m_info.options().userVerificationAvailability());
    98100    driver().transact(WTFMove(cborCmd), [weakThis = makeWeakPtr(*this)](Vector<uint8_t>&& data) {
    99101        ASSERT(RunLoop::isMain());
Note: See TracChangeset for help on using the changeset viewer.