Skip to content
Permalink
Browse files
Update getAllLocalAuthenticatorCredentials query according to interna…
…l needs

https://bugs.webkit.org/show_bug.cgi?id=231439
rdar://84032359

Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-08
Reviewed by Tim Horton.

Covered by manual tests.

* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(updateQueryIfNecessary):
(getAllLocalAuthenticatorCredentialsImpl):

Canonical link: https://commits.webkit.org/242717@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pascoej authored and webkit-commit-queue committed Oct 8, 2021
1 parent 83025a7 commit b71d4b2c685779bc1600201a87cbdf557911e2bd
Showing 2 changed files with 29 additions and 3 deletions.
@@ -1,3 +1,17 @@
2021-10-08 John Pascoe <j_pascoe@apple.com>

Update getAllLocalAuthenticatorCredentials query according to internal needs
https://bugs.webkit.org/show_bug.cgi?id=231439
rdar://84032359

Reviewed by Tim Horton.

Covered by manual tests.

* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(updateQueryIfNecessary):
(getAllLocalAuthenticatorCredentialsImpl):

2021-10-08 Basuke Suzuki <basuke.suzuki@sony.com>

Fix build break after r283796 when ENABLE_SERVICE_WORKER is off
@@ -61,6 +61,15 @@
#import <wtf/text/Base64.h>

#if ENABLE(WEB_AUTHN)

#if USE(APPLE_INTERNAL_SDK)
#import <WebKitAdditions/LocalAuthenticatorAdditions.h>
#else
static void updateQueryIfNecessary(NSMutableDictionary *)
{
}
#endif

static RetainPtr<NSData> produceClientDataJson(_WKWebAuthenticationType type, NSData *challenge, NSString *origin)
{
auto dictionary = adoptNS([[NSMutableDictionary alloc] init]);
@@ -203,16 +212,19 @@ - (void)setDelegate:(id<_WKWebAuthenticationPanelDelegate>)delegate
#if ENABLE(WEB_AUTHN)
static RetainPtr<NSArray> getAllLocalAuthenticatorCredentialsImpl(NSString *accessGroup)
{
NSDictionary *query = @{
auto query = adoptNS([[NSMutableDictionary alloc] init]);
[query setDictionary:@{
(__bridge id)kSecClass: (__bridge id)kSecClassKey,
(__bridge id)kSecAttrKeyClass: (__bridge id)kSecAttrKeyClassPrivate,
(__bridge id)kSecAttrAccessGroup: accessGroup,
(__bridge id)kSecReturnAttributes: @YES,
(__bridge id)kSecMatchLimit: (__bridge id)kSecMatchLimitAll,
(__bridge id)kSecUseDataProtectionKeychain: @YES
};
}];
updateQueryIfNecessary(query.get());

CFTypeRef attributesArrayRef = nullptr;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &attributesArrayRef);
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query.get(), &attributesArrayRef);
if (status && status != errSecItemNotFound)
return nullptr;
auto retainAttributesArray = adoptCF(attributesArrayRef);

0 comments on commit b71d4b2

Please sign in to comment.