Title: [272255] branches/safari-611-branch/Source/WebKit
Revision
272255
Author
[email protected]
Date
2021-02-02 17:39:41 -0800 (Tue, 02 Feb 2021)

Log Message

Cherry-pick r271754. rdar://problem/73890755

    [WebAuthn] No error is visible after user enters the incorrect PIN
    https://bugs.webkit.org/show_bug.cgi?id=220839
    <rdar://problem/73378319>

    Reviewed by Brent Fulgham.

    To fix that, let's have a boolean to indicate the PIN entry UI has already been presented within this session.
    And then rely on the error UI to let users retry the PIN.

    Covered by manual tests.

    * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h:
    * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
    (WebKit::AuthenticatorPresenterCoordinator::requestPin):
    (WebKit::AuthenticatorPresenterCoordinator::selectAssertionResponse):
    Besides above, this patch also fixes some crashes.

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebKit/ChangeLog (272254 => 272255)


--- branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-03 01:39:38 UTC (rev 272254)
+++ branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-03 01:39:41 UTC (rev 272255)
@@ -1,5 +1,48 @@
 2021-02-02  Alan Coon  <[email protected]>
 
+        Cherry-pick r271754. rdar://problem/73890755
+
+    [WebAuthn] No error is visible after user enters the incorrect PIN
+    https://bugs.webkit.org/show_bug.cgi?id=220839
+    <rdar://problem/73378319>
+    
+    Reviewed by Brent Fulgham.
+    
+    To fix that, let's have a boolean to indicate the PIN entry UI has already been presented within this session.
+    And then rely on the error UI to let users retry the PIN.
+    
+    Covered by manual tests.
+    
+    * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h:
+    * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
+    (WebKit::AuthenticatorPresenterCoordinator::requestPin):
+    (WebKit::AuthenticatorPresenterCoordinator::selectAssertionResponse):
+    Besides above, this patch also fixes some crashes.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-22  Jiewen Tan  <[email protected]>
+
+            [WebAuthn] No error is visible after user enters the incorrect PIN
+            https://bugs.webkit.org/show_bug.cgi?id=220839
+            <rdar://problem/73378319>
+
+            Reviewed by Brent Fulgham.
+
+            To fix that, let's have a boolean to indicate the PIN entry UI has already been presented within this session.
+            And then rely on the error UI to let users retry the PIN.
+
+            Covered by manual tests.
+
+            * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h:
+            * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
+            (WebKit::AuthenticatorPresenterCoordinator::requestPin):
+            (WebKit::AuthenticatorPresenterCoordinator::selectAssertionResponse):
+            Besides above, this patch also fixes some crashes.
+
+2021-02-02  Alan Coon  <[email protected]>
+
         Cherry-pick r271737. rdar://problem/73890706
 
     PiP video subtitles stop updating when Safari is backgrounded

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h (272254 => 272255)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h	2021-02-03 01:39:38 UTC (rev 272254)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h	2021-02-03 01:39:41 UTC (rev 272255)
@@ -87,6 +87,9 @@
     HashMap<String, RefPtr<WebCore::AuthenticatorAssertionResponse>> m_credentials;
 
     CompletionHandler<void(const String&)> m_pinHandler;
+#if HAVE(ASC_AUTH_UI)
+    bool m_presentedPIN { false };
+#endif
 };
 
 } // namespace WebKit

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm (272254 => 272255)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm	2021-02-03 01:39:38 UTC (rev 272254)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm	2021-02-03 01:39:41 UTC (rev 272255)
@@ -152,7 +152,13 @@
 void AuthenticatorPresenterCoordinator::requestPin(uint64_t, CompletionHandler<void(const String&)>&& completionHandler)
 {
 #if HAVE(ASC_AUTH_UI)
+    if (m_pinHandler)
+        m_pinHandler(String());
     m_pinHandler = WTFMove(completionHandler);
+
+    if (m_presentedPIN)
+        return;
+    m_presentedPIN = true;
     [m_presenter presentPINEntryInterface];
 #endif // HAVE(ASC_AUTH_UI)
 }
@@ -169,6 +175,9 @@
 
         m_credentials.clear();
         for (auto& response : responses) {
+            if (!response->name())
+                continue;
+
             RetainPtr<NSData> userHandle;
             if (response->userHandle())
                 userHandle = adoptNS([[NSData alloc] initWithBytes:response->userHandle()->data() length:response->userHandle()->byteLength()]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to