Commit e140358
committed
WebAuthn Authentication over NFC is broken in Safari Technology Preview 234 (SEED)
rdar://168456474
https://bugs.webkit.org/show_bug.cgi?id=306279
Reviewed by Brent Fulgham.
This patch makes a few changes to make CCID authenticators behave better.
1. Some newer authenticators have inconsistent behavior whenever we start a session
per-message. This change moves us to maintaining a session with a smart card until
invalidated and queuing messages as-needed.
2. We do not handle the kCtap2ErrUserPresenceRequired, which the authenticator
returns when it was left on an NFC reader for too long. We were looping on this
terminal error until we encountered the next issue fixed.
3. At one point we stopped handling the kCtap2ErrPinAuthBlocked error properly. This
error can be delievered before pin entry is attempted for an already locked
authenticator and this error gets returned whenever the platform ignores kCtap2ErrUserPresenceRequired.
This also required an internal change in rdar://168804001.
* Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp:
(fido::isCtapDeviceResponseCode):
* Source/WebCore/Modules/webauthn/fido/FidoConstants.h:
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
(WebKit::AuthenticatorPresenterCoordinator::updatePresenter):
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidConnection.h:
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidConnection.mm:
(-[WKSmartCardObserver initWithCard:invalidationHandler:]):
(-[WKSmartCardObserver dealloc]):
(-[WKSmartCardObserver observeValueForKeyPath:ofObject:change:context:]):
(WebKit::CcidConnection::create):
(WebKit::CcidConnection::CcidConnection):
(WebKit::CcidConnection::~CcidConnection):
(WebKit::CcidConnection::detectContactless):
(WebKit::CcidConnection::transact):
(WebKit::CcidConnection::processPendingRequests):
(WebKit::CcidConnection::stop):
(WebKit::CcidConnection::startPolling):
(WebKit::CcidConnection::transact const): Deleted.
(WebKit::CcidConnection::stop const): Deleted.
(WebKit::CcidConnection::restartPolling): Deleted.
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.h:
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/CcidService.mm:
(WebKit::CcidService::~CcidService):
(WebKit::CcidService::platformStartDiscovery):
(WebKit::CcidService::onValidCard):
(WebKit::CcidService::onCardRemoved):
(-[_WKSmartCardSlotStateObserver observeValueForKeyPath:ofObject:change:context:]):
* Source/WebKit/UIProcess/WebAuthentication/Mock/MockCcidService.mm:
(WebKit::MockCcidService::platformStartDiscovery):
* Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
(WebKit::CtapAuthenticator::continueSilentlyCheckCredentials):
(WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
(WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST(WebAuthenticationPanel, MakeCredentialPinAuthBlockedError)):
(TestWebKitAPI::TEST(WebAuthenticationPanel, GetAssertionPinAuthBlockedError)):
Canonical link: https://commits.webkit.org/306280@main1 parent a9bbaa7 commit e140358
File tree
10 files changed
+239
-43
lines changed- Source
- WebCore/Modules/webauthn/fido
- WebKit/UIProcess/WebAuthentication
- Cocoa
- Mock
- fido
- Tools/TestWebKitAPI/Tests/WebKitCocoa
10 files changed
+239
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
47 | | - | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
52 | 55 | | |
53 | | - | |
54 | 56 | | |
55 | | - | |
56 | 57 | | |
57 | | - | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
Lines changed: 141 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
37 | 88 | | |
38 | 89 | | |
39 | 90 | | |
40 | | - | |
| 91 | + | |
41 | 92 | | |
42 | | - | |
| 93 | + | |
43 | 94 | | |
44 | 95 | | |
45 | | - | |
| 96 | + | |
46 | 97 | | |
| 98 | + | |
47 | 99 | | |
48 | | - | |
49 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
50 | 117 | | |
51 | 118 | | |
52 | 119 | | |
53 | 120 | | |
54 | 121 | | |
| 122 | + | |
55 | 123 | | |
56 | 124 | | |
57 | 125 | | |
| |||
69 | 137 | | |
70 | 138 | | |
71 | 139 | | |
| 140 | + | |
72 | 141 | | |
73 | 142 | | |
74 | 143 | | |
| |||
98 | 167 | | |
99 | 168 | | |
100 | 169 | | |
101 | | - | |
| 170 | + | |
102 | 171 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
109 | 188 | | |
110 | 189 | | |
111 | 190 | | |
112 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
113 | 227 | | |
114 | 228 | | |
115 | 229 | | |
116 | | - | |
| 230 | + | |
117 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
118 | 237 | | |
119 | 238 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 239 | + | |
123 | 240 | | |
124 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
125 | 249 | | |
126 | 250 | | |
127 | 251 | | |
128 | 252 | | |
129 | 253 | | |
130 | | - | |
131 | 254 | | |
132 | 255 | | |
133 | 256 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
0 commit comments