Changeset 288622 in webkit


Ignore:
Timestamp:
Jan 26, 2022 8:59:14 AM (6 months ago)
Author:
J Pascoe
Message:

[WebAuthn] Add authenticator attachment used during authentication to credential payload
https://bugs.webkit.org/show_bug.cgi?id=235621
rdar://86538235

Reviewed by Dean Jackson.

Source/WebCore:

This patch adds the authenticator attachment used to the credential response in get/create
webauthn calls as described in the merged PR to the spec: https://github.com/w3c/webauthn/pull/1668/files

Modified layout tests to check for authenticator attachment = (cross-platform/platform) where appropriate
and verified response in manual calls.

  • Modules/webauthn/PublicKeyCredential.cpp:

(WebCore::PublicKeyCredential::authenticatorAttachment const):

  • Modules/webauthn/PublicKeyCredential.h:
  • Modules/webauthn/PublicKeyCredential.idl:

LayoutTests:

Modify webauthn layout tests to check for new authenticatorAttachment field.

  • http/wpt/webauthn/public-key-credential-get-success-local.https.html:
  • http/wpt/webauthn/resources/util.js:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r288621 r288622  
     12022-01-26  J Pascoe  <j_pascoe@apple.com>
     2
     3        [WebAuthn] Add authenticator attachment used during authentication to credential payload
     4        https://bugs.webkit.org/show_bug.cgi?id=235621
     5        rdar://86538235
     6
     7        Reviewed by Dean Jackson.
     8
     9        Modify webauthn layout tests to check for new authenticatorAttachment field.       
     10        * http/wpt/webauthn/public-key-credential-get-success-local.https.html:
     11        * http/wpt/webauthn/resources/util.js:
     12
    1132022-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-local.https.html

    r276180 r288622  
    1717        assert_array_equals(new Uint8Array(credential.response.userHandle), Base64URL.parse(testUserhandleBase64));
    1818        assert_not_own_property(credential.getClientExtensionResults(), "appid");
     19        assert_equals(credential.authenticatorAttachment, 'platform');
    1920
    2021        // Check authData
  • trunk/LayoutTests/http/wpt/webauthn/resources/util.js

    r287116 r288622  
    426426    assert_array_equals(Base64URL.parse(credential.id), Base64URL.parse(testHidCredentialIdBase64));
    427427    assert_equals(credential.type, 'public-key');
     428    assert_equals(credential.authenticatorAttachment, 'cross-platform')
    428429    assert_array_equals(new Uint8Array(credential.rawId), Base64URL.parse(testHidCredentialIdBase64));
    429430    assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.get","challenge":"MTIzNDU2","origin":"https://localhost:9443"}');
  • trunk/Source/WebCore/ChangeLog

    r288621 r288622  
     12022-01-26  J Pascoe  <j_pascoe@apple.com>
     2
     3        [WebAuthn] Add authenticator attachment used during authentication to credential payload
     4        https://bugs.webkit.org/show_bug.cgi?id=235621
     5        rdar://86538235
     6
     7        Reviewed by Dean Jackson.
     8
     9        This patch adds the authenticator attachment used to the credential response in get/create
     10        webauthn calls as described in the merged PR to the spec: https://github.com/w3c/webauthn/pull/1668/files
     11
     12        Modified layout tests to check for authenticator attachment = (cross-platform/platform) where appropriate
     13        and verified response in manual calls.
     14
     15        * Modules/webauthn/PublicKeyCredential.cpp:
     16        (WebCore::PublicKeyCredential::authenticatorAttachment const):
     17        * Modules/webauthn/PublicKeyCredential.h:
     18        * Modules/webauthn/PublicKeyCredential.idl:
     19
    1202022-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp

    r277740 r288622  
    5454}
    5555
     56AuthenticatorAttachment PublicKeyCredential::authenticatorAttachment() const
     57{
     58    return m_response->attachment();
     59}
     60
    5661PublicKeyCredential::PublicKeyCredential(Ref<AuthenticatorResponse>&& response)
    5762    : BasicCredential(base64URLEncodeToString(response->rawId()->data(), response->rawId()->byteLength()), Type::PublicKey, Discovery::Remote)
  • trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.h

    r253398 r288622  
    3434namespace WebCore {
    3535
     36enum class AuthenticatorAttachment;
    3637class AuthenticatorResponse;
    3738class Document;
     
    4748    ArrayBuffer* rawId() const;
    4849    AuthenticatorResponse* response() const { return m_response.ptr(); }
     50    AuthenticatorAttachment authenticatorAttachment() const;
    4951    AuthenticationExtensionsClientOutputs getClientExtensionResults() const;
    5052
  • trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl

    r283463 r288622  
    3232    [SameObject] readonly attribute ArrayBuffer rawId;
    3333    [SameObject] readonly attribute AuthenticatorResponse response;
     34    [SameObject] readonly attribute AuthenticatorAttachment? authenticatorAttachment;
    3435    AuthenticationExtensionsClientOutputs getClientExtensionResults();
    3536
Note: See TracChangeset for help on using the changeset viewer.