[WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::Authen...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2018 20:28:07 +0000 (20:28 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2018 20:28:07 +0000 (20:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191522

Reviewed by Brent Fulgham.

Source/WebCore:

Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria

Covered by existing tests.

* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):

Source/WebKit:

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp

index 0f66737..702b28a 100644 (file)
@@ -1,3 +1,18 @@
+2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=191522
+
+        Reviewed by Brent Fulgham.
+
+        Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
+        https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
+
+        Covered by existing tests.
+
+        * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
+        (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
+
 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
 
         DragImage should have a complete default implementation
index 31f3229..ba68df9 100644 (file)
@@ -66,8 +66,7 @@ struct PublicKeyCredentialCreationOptions {
     };
 
     struct AuthenticatorSelectionCriteria {
-        // FIXME(191522)
-        AuthenticatorAttachment authenticatorAttachment { AuthenticatorAttachment::CrossPlatform };
+        std::optional<AuthenticatorAttachment> authenticatorAttachment;
         bool requireResidentKey { false };
         UserVerificationRequirement userVerification { UserVerificationRequirement::Preferred };
 
@@ -117,7 +116,7 @@ std::optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria
 {
     PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria result;
 
-    std::optional<AuthenticatorAttachment> authenticatorAttachment;
+    std::optional<std::optional<AuthenticatorAttachment>> authenticatorAttachment;
     decoder >> authenticatorAttachment;
     if (!authenticatorAttachment)
         return std::nullopt;
index 8664787..cb8b9c2 100644 (file)
@@ -1,3 +1,13 @@
+2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=191522
+
+        Reviewed by Brent Fulgham.
+
+        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
+        (WebKit::AuthenticatorManagerInternal::collectTransports):
+
 2018-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [SOUP] Make Accept-Languages header look more like other browsers
index 2c4e76a..6595f9c 100644 (file)
@@ -49,7 +49,7 @@ const unsigned maxTimeOutValue = 120000;
 static AuthenticatorManager::TransportSet collectTransports(const std::optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria>& authenticatorSelection)
 {
     AuthenticatorManager::TransportSet result;
-    if (!authenticatorSelection) {
+    if (!authenticatorSelection || !authenticatorSelection->authenticatorAttachment) {
         auto addResult = result.add(AuthenticatorTransport::Internal);
         ASSERT_UNUSED(addResult, addResult.isNewEntry);
 #if PLATFORM(MAC)