Title: [295641] trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
- Revision
- 295641
- Author
- j_pas...@apple.com
- Date
- 2022-06-17 11:57:08 -0700 (Fri, 17 Jun 2022)
Log Message
[WebAuthn] Upgrading a legacy platform credential to a passkey does not delete the legacy credential
https://bugs.webkit.org/show_bug.cgi?id=241608
rdar://95059952
Reviewed by Brent Fulgham.
* Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::deleteDuplicateCredential const):
Query credentials by user handle, regardless of sync status to properly remove
legacy credentials.
Canonical link: https://commits.webkit.org/251646@main
Modified Paths
Diff
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm (295640 => 295641)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-06-17 18:03:22 UTC (rev 295640)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-06-17 18:57:08 UTC (rev 295641)
@@ -670,15 +670,14 @@
if (memcmp(userHandle->data(), creationOptions.user.id.data(), userHandle->byteLength()))
return false;
- auto query = adoptNS([[NSMutableDictionary alloc] init]);
- [query setDictionary:@{
+ NSDictionary *query = @{
(id)kSecClass: (id)kSecClassKey,
(id)kSecAttrApplicationLabel: toNSData(credential->rawId()).get(),
+ (id)kSecAttrSynchronizable: (id)kSecAttrSynchronizableAny,
(id)kSecUseDataProtectionKeychain: @YES
- }];
- updateQueryIfNecessary(query.get());
+ };
- OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query.get());
+ OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query);
if (status && status != errSecItemNotFound)
LOG_ERROR(makeString("Couldn't delete older credential: "_s, status).utf8().data());
return true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes