Changeset 169682 in webkit


Ignore:
Timestamp:
Jun 8, 2014 12:28:40 PM (10 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/17208234> [Mac] Client-certificate authentication isn’t working when using the modern API
https://bugs.webkit.org/show_bug.cgi?id=133617

Reviewed by Sam Weinig.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<Credential>::encode): Encode certificate credentials on Mac as well.
(IPC::ArgumentCoder<Credential>::decode): Decode certificate credentials on Mac as well.

  • Shared/cf/ArgumentCodersCF.cpp:

(IPC::encode): Use OS X API for getting a persistent reference to a key.
(IPC::decode): Use OS X API for getting a key from a persistent reference.

  • Shared/cf/ArgumentCodersCF.h: Make identity coding available on Mac as well.
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r169680 r169682  
     12014-06-08  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/17208234> [Mac] Client-certificate authentication isn’t working when using the modern API
     4        https://bugs.webkit.org/show_bug.cgi?id=133617
     5
     6        Reviewed by Sam Weinig.
     7
     8        * Shared/WebCoreArgumentCoders.cpp:
     9        (IPC::ArgumentCoder<Credential>::encode): Encode certificate credentials on Mac as well.
     10        (IPC::ArgumentCoder<Credential>::decode): Decode certificate credentials on Mac as well.
     11
     12        * Shared/cf/ArgumentCodersCF.cpp:
     13        (IPC::encode): Use OS X API for getting a persistent reference to a key.
     14        (IPC::decode): Use OS X API for getting a key from a persistent reference.
     15
     16        * Shared/cf/ArgumentCodersCF.h: Make identity coding available on Mac as well.
     17
    1182014-06-07  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp

    r169679 r169682  
    495495void ArgumentCoder<Credential>::encode(ArgumentEncoder& encoder, const Credential& credential)
    496496{
    497 #if CERTIFICATE_CREDENTIALS_SUPPORTED && PLATFORM(IOS)
     497#if CERTIFICATE_CREDENTIALS_SUPPORTED
    498498    encoder.encodeEnum(credential.type());
    499499
     
    516516bool ArgumentCoder<Credential>::decode(ArgumentDecoder& decoder, Credential& credential)
    517517{
    518 #if CERTIFICATE_CREDENTIALS_SUPPORTED && PLATFORM(IOS)
     518#if CERTIFICATE_CREDENTIALS_SUPPORTED
    519519    CredentialType type;
    520520
  • trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp

    r169658 r169682  
    3737#endif
    3838
    39 #if PLATFORM(IOS)
    4039#if defined(__has_include) && __has_include(<Security/SecIdentityPriv.h>)
    4140#include <Security/SecIdentityPriv.h>
     
    4443extern "C" SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
    4544
     45#if PLATFORM(IOS)
    4646#if defined(__has_include) && __has_include(<Security/SecKeyPriv.h>)
    4747#include <Security/SecKeyPriv.h>
     
    592592}
    593593
    594 #if PLATFORM(IOS)
    595594void encode(ArgumentEncoder& encoder, SecIdentityRef identity)
    596595{
     
    604603
    605604    CFDataRef keyData = nullptr;
     605#if PLATFORM(IOS)
    606606    SecKeyCopyPersistentRef(key, &keyData);
     607#endif
     608#if PLATFORM(MAC)
     609    SecKeychainItemCreatePersistentReference((SecKeychainItemRef)key, &keyData);
     610#endif
    607611    CFRelease(key);
    608612
     
    632636
    633637    SecKeyRef key = nullptr;
     638#if PLATFORM(IOS)
    634639    SecKeyFindWithPersistentRef(keyData.get(), &key);
     640#endif
     641#if PLATFORM(MAC)
     642    SecKeychainItemCopyFromPersistentReference(keyData.get(), (SecKeychainItemRef*)&key);
     643#endif
    635644    if (key) {
    636645        result = adoptCF(SecIdentityCreate(kCFAllocatorDefault, certificate.get(), key));
     
    640649    return true;
    641650}
    642 #endif
    643651
    644652#if HAVE(SEC_KEYCHAIN)
  • trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h

    r169658 r169682  
    7979bool decode(ArgumentDecoder&, RetainPtr<SecCertificateRef>& result);
    8080
    81 #if PLATFORM(IOS)
    8281// SecIdentityRef
    8382void encode(ArgumentEncoder&, SecIdentityRef);
    8483bool decode(ArgumentDecoder&, RetainPtr<SecIdentityRef>& result);
    85 #endif
    8684
    8785#if HAVE(SEC_KEYCHAIN)
Note: See TracChangeset for help on using the changeset viewer.