Changeset 253366 in webkit


Ignore:
Timestamp:
Dec 11, 2019 3:07:45 AM (4 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support
https://bugs.webkit.org/show_bug.cgi?id=205100
<rdar://problem/57822953>

Reviewed by Brent Fulgham.

This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support.
CTAP PIN is a way for authenticators to be able to do user verification by asking
clients/users for a pre-set PIN. Here is the spec:
https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
In order to support this, WebKit needs to interacts with UIClients to ask users
to enter the PINs. Therefore, a new set of SPI is needed.

Here is the proposed SPI for WebKit to ask Safari for the PIN:
@protocol _WKWebAuthenticationPanelDelegate <NSObject>
@optional
...

  • (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void ()(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

...
@end

Retries is the number of retires before the authenticator getting blocked, which
is a state that only factory reset can save the authenticator. UIClients can have
a threshold and WARN users loudly when the threshold is reached.
A byte array that is less than or equal to 63 bytes is expected to return to the
passed completion handler. Otherwise, the completion handler will bail out.

For error handling:
typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {

...
_WKWebAuthenticationPanelUpdatePINBlocked,
_WKWebAuthenticationPanelUpdatePINAuthBlocked,
_WKWebAuthenticationPanelUpdatePINInvalid,

} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI.
_WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory
reset is needed.
_WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The
authenticator will need to be reconnected.
_WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will
often be followed with another requestPINWithRetries delegate call.
Here is the spec for the error:
https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential.

  • UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r253360 r253366  
     12019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support
     4        https://bugs.webkit.org/show_bug.cgi?id=205100
     5        <rdar://problem/57822953>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support.
     10        CTAP PIN is a way for authenticators to be able to do user verification by asking
     11        clients/users for a pre-set PIN. Here is the spec:
     12        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
     13        In order to support this, WebKit needs to interacts with UIClients to ask users
     14        to enter the PINs. Therefore, a new set of SPI is needed.
     15
     16        Here is the proposed SPI for WebKit to ask Safari for the PIN:
     17        @protocol _WKWebAuthenticationPanelDelegate <NSObject>
     18        @optional
     19        ...
     20        - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     21        ...
     22        @end
     23
     24        Retries is the number of retires before the authenticator getting blocked, which
     25        is a state that only factory reset can save the authenticator. UIClients can have
     26        a threshold and WARN users loudly when the threshold is reached.
     27        A byte array that is less than or equal to 63 bytes is expected to return to the
     28        passed completion handler. Otherwise, the completion handler will bail out.
     29
     30        For error handling:
     31        typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {
     32            ...
     33            _WKWebAuthenticationPanelUpdatePINBlocked,
     34            _WKWebAuthenticationPanelUpdatePINAuthBlocked,
     35            _WKWebAuthenticationPanelUpdatePINInvalid,
     36        } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     37
     38        The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI.
     39        _WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory
     40        reset is needed.
     41        _WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The
     42        authenticator will need to be reconnected.
     43        _WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will
     44        often be followed with another requestPINWithRetries delegate call.
     45        Here is the spec for the error:
     46        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential.
     47
     48        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
     49
    1502019-12-10  Chris Dumez  <cdumez@apple.com>
    251
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h

    r251762 r253366  
    4343    _WKWebAuthenticationPanelUpdateMultipleNFCTagsPresent,
    4444    _WKWebAuthenticationPanelUpdateNoCredentialsFound,
     45    _WKWebAuthenticationPanelUpdatePINBlocked,
     46    _WKWebAuthenticationPanelUpdatePINAuthBlocked,
     47    _WKWebAuthenticationPanelUpdatePINInvalid,
    4548} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    4649
     
    6669- (void)panel:(_WKWebAuthenticationPanel *)panel updateWebAuthenticationPanel:(_WKWebAuthenticationPanelUpdate)update WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    6770- (void)panel:(_WKWebAuthenticationPanel *)panel dismissWebAuthenticationPanelWithResult:(_WKWebAuthenticationResult)result WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     71- (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    6872
    6973@end
Note: See TracChangeset for help on using the changeset viewer.