Changeset 169655 in webkit
- Timestamp:
- Jun 6, 2014 12:04:10 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r169654 r169655 1 2014-06-06 Dan Bernstein <mitz@apple.com> 2 3 WebCore part of <rdar://problem/17095692> [iOS] Client-certificate authentication isn’t working 4 https://bugs.webkit.org/show_bug.cgi?id=133527 5 6 Reviewed by Darin Adler. 7 8 * WebCore.exp.in: Exported some Credential member functions. 9 1 10 2014-06-06 Dean Jackson <dino@apple.com> 2 11 -
trunk/Source/WebCore/WebCore.exp.in
r169625 r169655 72 72 __ZN7WebCore10ClientRectC1ERKNS_9FloatRectE 73 73 __ZN7WebCore10ClientRectC1Ev 74 __ZN7WebCore10CredentialC1EP13__SecIdentityPK9__CFArrayNS_21CredentialPersistenceE 74 75 __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE 75 76 __ZN7WebCore10CredentialC1Ev … … 1506 1507 __ZNK7WebCore10Credential11hasPasswordEv 1507 1508 __ZNK7WebCore10Credential11persistenceEv 1509 __ZNK7WebCore10Credential12certificatesEv 1510 __ZNK7WebCore10Credential4typeEv 1508 1511 __ZNK7WebCore10Credential4userEv 1509 1512 __ZNK7WebCore10Credential7isEmptyEv 1513 __ZNK7WebCore10Credential8identityEv 1510 1514 __ZNK7WebCore10Credential8passwordEv 1511 1515 __ZNK7WebCore10FloatPointcv7CGPointEv -
trunk/Source/WebKit2/ChangeLog
r169626 r169655 1 2014-06-06 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/17095692> [iOS] Client-certificate authentication isn’t working 4 https://bugs.webkit.org/show_bug.cgi?id=133527 5 6 Reviewed by Darin Adler. 7 8 * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys 9 needed to create identities to authenticate with. 10 11 * Shared/WebCoreArgumentCoders.cpp: 12 (IPC::ArgumentCoder<Credential>::encode): Encode the credential type, and if it is a client 13 certificate, encode the identity and the certificates. 14 (IPC::ArgumentCoder<Credential>::decode): Decode the credential type. If it is a client 15 certificate, decode the identity and the certificates and use the proper Credential 16 constructor. 17 18 * Shared/cf/ArgumentCodersCF.cpp: 19 (IPC::typeFromCFTypeRef): Handle SecIdentityRef. 20 (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to 21 its key. 22 (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and 23 create an identity. 24 * Shared/cf/ArgumentCodersCF.h: 25 1 26 2014-06-05 Benjamin Poulain <bpoulain@apple.com> 2 27 -
trunk/Source/WebKit2/Configurations/Network-iOS.entitlements
r166103 r169655 5 5 <key>com.apple.private.network.socket-delegate</key> 6 6 <true/> 7 <key>keychain-access-groups</key> 8 <array> 9 <string>com.apple.identities</string> 10 </array> 7 11 </dict> 8 12 </plist> -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r168845 r169655 70 70 #include <wtf/text/StringHash.h> 71 71 72 #if PLATFORM(COCOA) 73 #include "ArgumentCodersCF.h" 74 #endif 75 72 76 #if PLATFORM(IOS) 73 77 #include <WebCore/FloatQuad.h> … … 468 472 void ArgumentCoder<Credential>::encode(ArgumentEncoder& encoder, const Credential& credential) 469 473 { 474 #if CERTIFICATE_CREDENTIALS_SUPPORTED 475 encoder.encodeEnum(credential.type()); 476 477 if (credential.type() == CredentialTypeClientCertificate) { 478 IPC::encode(encoder, credential.identity()); 479 480 encoder << !!credential.certificates(); 481 if (credential.certificates()) 482 IPC::encode(encoder, credential.certificates()); 483 484 encoder.encodeEnum(credential.persistence()); 485 return; 486 } 487 #endif 470 488 encoder << credential.user() << credential.password(); 489 471 490 encoder.encodeEnum(credential.persistence()); 472 491 } … … 474 493 bool ArgumentCoder<Credential>::decode(ArgumentDecoder& decoder, Credential& credential) 475 494 { 495 #if CERTIFICATE_CREDENTIALS_SUPPORTED 496 CredentialType type; 497 498 if (!decoder.decodeEnum(type)) 499 return false; 500 501 if (type == CredentialTypeClientCertificate) { 502 RetainPtr<SecIdentityRef> identity; 503 if (!IPC::decode(decoder, identity)) 504 return false; 505 506 bool hasCertificates; 507 if (!decoder.decode(hasCertificates)) 508 return false; 509 510 RetainPtr<CFArrayRef> certificates; 511 if (hasCertificates) { 512 if (!IPC::decode(decoder, certificates)) 513 return false; 514 } 515 516 CredentialPersistence persistence; 517 if (!decoder.decodeEnum(persistence)) 518 return false; 519 520 credential = Credential(identity.get(), certificates.get(), persistence); 521 return true; 522 } 523 #endif 524 476 525 String user; 477 526 if (!decoder.decode(user)) -
trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp
r163886 r169655 37 37 #endif 38 38 39 #if defined(__has_include) && __has_include(<Security/SecIdentityPriv.h>) 40 #include <Security/SecIdentityPriv.h> 41 #endif 42 43 extern "C" SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey); 44 45 #if defined(__has_include) && __has_include(<Security/SecKeyPriv.h>) 46 #include <Security/SecKeyPriv.h> 47 #endif 48 49 extern "C" OSStatus SecKeyCopyPersistentRef(SecKeyRef key, CFDataRef* persistentRef); 50 extern "C" OSStatus SecKeyFindWithPersistentRef(CFDataRef persistentRef, SecKeyRef* lookedUpData); 51 39 52 using namespace WebCore; 40 53 … … 58 71 CFURL, 59 72 SecCertificate, 73 SecIdentity, 60 74 #if HAVE(SEC_KEYCHAIN) 61 75 SecKeychainItem, … … 93 107 if (typeID == SecCertificateGetTypeID()) 94 108 return SecCertificate; 109 if (typeID == SecIdentityGetTypeID()) 110 return SecIdentity; 95 111 #if HAVE(SEC_KEYCHAIN) 96 112 if (typeID == SecKeychainItemGetTypeID()) … … 136 152 case SecCertificate: 137 153 encode(encoder, (SecCertificateRef)typeRef); 154 return; 155 case SecIdentity: 156 encode(encoder, (SecIdentityRef)(typeRef)); 138 157 return; 139 158 #if HAVE(SEC_KEYCHAIN) … … 222 241 return false; 223 242 result = adoptCF(certificate.leakRef()); 243 return true; 244 } 245 case SecIdentity: { 246 RetainPtr<SecIdentityRef> identity; 247 if (!decode(decoder, identity)) 248 return false; 249 result = adoptCF(identity.leakRef()); 224 250 return true; 225 251 } … … 556 582 } 557 583 584 void encode(ArgumentEncoder& encoder, SecIdentityRef identity) 585 { 586 SecCertificateRef certificate = nullptr; 587 SecIdentityCopyCertificate(identity, &certificate); 588 encode(encoder, certificate); 589 CFRelease(certificate); 590 591 SecKeyRef key = nullptr; 592 SecIdentityCopyPrivateKey(identity, &key); 593 594 CFDataRef keyData = nullptr; 595 SecKeyCopyPersistentRef(key, &keyData); 596 CFRelease(key); 597 598 encoder << !!keyData; 599 if (keyData) { 600 encode(encoder, keyData); 601 CFRelease(keyData); 602 } 603 } 604 605 bool decode(ArgumentDecoder& decoder, RetainPtr<SecIdentityRef>& result) 606 { 607 RetainPtr<SecCertificateRef> certificate; 608 if (!decode(decoder, certificate)) 609 return false; 610 611 bool hasKey; 612 if (!decoder.decode(hasKey)) 613 return false; 614 615 if (!hasKey) 616 return true; 617 618 RetainPtr<CFDataRef> keyData; 619 if (!decode(decoder, keyData)) 620 return false; 621 622 SecKeyRef key = nullptr; 623 SecKeyFindWithPersistentRef(keyData.get(), &key); 624 if (key) { 625 result = adoptCF(SecIdentityCreate(kCFAllocatorDefault, certificate.get(), key)); 626 CFRelease(key); 627 } 628 629 return true; 630 } 631 558 632 #if HAVE(SEC_KEYCHAIN) 559 633 void encode(ArgumentEncoder& encoder, SecKeychainItemRef keychainItem) -
trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h
r161148 r169655 79 79 bool decode(ArgumentDecoder&, RetainPtr<SecCertificateRef>& result); 80 80 81 // SecIdentityRef 82 void encode(ArgumentEncoder&, SecIdentityRef); 83 bool decode(ArgumentDecoder&, RetainPtr<SecIdentityRef>& result); 84 81 85 #if HAVE(SEC_KEYCHAIN) 82 86 // SecKeychainItemRef
Note: See TracChangeset
for help on using the changeset viewer.