Title: [288622] trunk
Revision
288622
Author
j_pas...@apple.com
Date
2022-01-26 08:59:14 -0800 (Wed, 26 Jan 2022)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288621 => 288622)


--- trunk/LayoutTests/ChangeLog	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/LayoutTests/ChangeLog	2022-01-26 16:59:14 UTC (rev 288622)
@@ -1,3 +1,15 @@
+2022-01-26  J Pascoe  <j_pas...@apple.com>
+
+        [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.
+
+        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:
+
 2022-01-26  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Data detectors sometimes show up in the wrong place when resizing images with Live Text

Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-local.https.html (288621 => 288622)


--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-local.https.html	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-local.https.html	2022-01-26 16:59:14 UTC (rev 288622)
@@ -16,6 +16,7 @@
         assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.get","challenge":"MTIzNDU2","origin":"https://localhost:9443"}');
         assert_array_equals(new Uint8Array(credential.response.userHandle), Base64URL.parse(testUserhandleBase64));
         assert_not_own_property(credential.getClientExtensionResults(), "appid");
+        assert_equals(credential.authenticatorAttachment, 'platform');
 
         // Check authData
         const authData = decodeAuthData(new Uint8Array(credential.response.authenticatorData));

Modified: trunk/LayoutTests/http/wpt/webauthn/resources/util.js (288621 => 288622)


--- trunk/LayoutTests/http/wpt/webauthn/resources/util.js	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/LayoutTests/http/wpt/webauthn/resources/util.js	2022-01-26 16:59:14 UTC (rev 288622)
@@ -425,6 +425,7 @@
     // Check respond
     assert_array_equals(Base64URL.parse(credential.id), Base64URL.parse(testHidCredentialIdBase64));
     assert_equals(credential.type, 'public-key');
+    assert_equals(credential.authenticatorAttachment, 'cross-platform')
     assert_array_equals(new Uint8Array(credential.rawId), Base64URL.parse(testHidCredentialIdBase64));
     assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.get","challenge":"MTIzNDU2","origin":"https://localhost:9443"}');
     if (userHandleBase64 == null)

Modified: trunk/Source/WebCore/ChangeLog (288621 => 288622)


--- trunk/Source/WebCore/ChangeLog	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/Source/WebCore/ChangeLog	2022-01-26 16:59:14 UTC (rev 288622)
@@ -1,3 +1,22 @@
+2022-01-26  J Pascoe  <j_pas...@apple.com>
+
+        [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.
+
+        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:
+
 2022-01-26  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Data detectors sometimes show up in the wrong place when resizing images with Live Text

Modified: trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp (288621 => 288622)


--- trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp	2022-01-26 16:59:14 UTC (rev 288622)
@@ -53,6 +53,11 @@
     return m_response->extensions();
 }
 
+AuthenticatorAttachment PublicKeyCredential::authenticatorAttachment() const
+{
+    return m_response->attachment();
+}
+
 PublicKeyCredential::PublicKeyCredential(Ref<AuthenticatorResponse>&& response)
     : BasicCredential(base64URLEncodeToString(response->rawId()->data(), response->rawId()->byteLength()), Type::PublicKey, Discovery::Remote)
     , m_response(WTFMove(response))

Modified: trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.h (288621 => 288622)


--- trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.h	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.h	2022-01-26 16:59:14 UTC (rev 288622)
@@ -33,6 +33,7 @@
 
 namespace WebCore {
 
+enum class AuthenticatorAttachment;
 class AuthenticatorResponse;
 class Document;
 
@@ -46,6 +47,7 @@
 
     ArrayBuffer* rawId() const;
     AuthenticatorResponse* response() const { return m_response.ptr(); }
+    AuthenticatorAttachment authenticatorAttachment() const;
     AuthenticationExtensionsClientOutputs getClientExtensionResults() const;
 
     static void isUserVerifyingPlatformAuthenticatorAvailable(Document&, DOMPromiseDeferred<IDLBoolean>&&);

Modified: trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl (288621 => 288622)


--- trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl	2022-01-26 16:49:09 UTC (rev 288621)
+++ trunk/Source/WebCore/Modules/webauthn/PublicKeyCredential.idl	2022-01-26 16:59:14 UTC (rev 288622)
@@ -31,6 +31,7 @@
 ] interface PublicKeyCredential : BasicCredential {
     [SameObject] readonly attribute ArrayBuffer rawId;
     [SameObject] readonly attribute AuthenticatorResponse response;
+    [SameObject] readonly attribute AuthenticatorAttachment? authenticatorAttachment;
     AuthenticationExtensionsClientOutputs getClientExtensionResults();
 
     [CallWith=Document] static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to