Bug 135206 - [iOS] Client-certificate authentication isn’t working with some certificates
Summary: [iOS] Client-certificate authentication isn’t working with some certificates
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-23 12:08 PDT by mitz
Modified: 2014-07-23 13:19 PDT (History)
0 users

See Also:


Attachments
Specify an access group when creating a persistent reference to a key (2.95 KB, patch)
2014-07-23 12:24 PDT, mitz
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2014-07-23 12:08:02 PDT
Responding to an authentication challenge with an identity-based credential fails when more than one copy of the identity’s private key exists in the keychain.
Comment 1 mitz 2014-07-23 12:11:29 PDT
<rdar://problem/17782623>
Comment 2 mitz 2014-07-23 12:24:01 PDT
Created attachment 235368 [details]
Specify an access group when creating a persistent reference to a key
Comment 3 Anders Carlsson 2014-07-23 12:33:22 PDT
Comment on attachment 235368 [details]
Specify an access group when creating a persistent reference to a key

View in context: https://bugs.webkit.org/attachment.cgi?id=235368&action=review

> Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp:637
> +    RetainPtr<NSDictionary> query = @{

This doesn't need to be a RetainPtr.
Comment 4 Alexey Proskuryakov 2014-07-23 12:38:10 PDT
Comment on attachment 235368 [details]
Specify an access group when creating a persistent reference to a key

View in context: https://bugs.webkit.org/attachment.cgi?id=235368&action=review

> Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp:632
> +static CFDataRef copyPersistentRef(SecKeyRef key)

This doesn't seem to be in a PLATFORM(IOS) ifdef, and it should.

> Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp:637
> +    RetainPtr<NSDictionary> query = @{

I don't see how this RetainPtr can be appropriate here.

> Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp:645
> +    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query.get(), &persistentRef);

Do we need __bridge in WebKit code?

> Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp:652
> +    if (CFGetTypeID(persistentRef) != CFDataGetTypeID()) {
> +        CFRelease(persistentRef);
> +        return nullptr;
> +    }

Can this happen? Documentation says that kSecReturnPersistentRef always provides a CFDataRef.
Comment 5 mitz 2014-07-23 13:19:19 PDT
Fixed in <http://trac.webkit.org/r171485>.