]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/lib/Identity.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / Identity.cpp
index f11974f4d09b4b537850c40ce87e29c55d349c4f..6447eb9b110ed02c176b05daf7bbd57af7cc63ca 100644 (file)
@@ -61,7 +61,7 @@ Identity::Identity(const StorageManager::KeychainList &keychains, const SecPoint
                                                            kCFAllocatorNull);
     // First, try the new iOS keychain.
     {
                                                            kCFAllocatorNull);
     // First, try the new iOS keychain.
     {
-        const void *keys[] = { kSecClass, kSecAttrKeyClass, kSecAttrApplicationLabel, kSecReturnRef, kSecAttrNoLegacy };
+        const void *keys[] = { kSecClass, kSecAttrKeyClass, kSecAttrApplicationLabel, kSecReturnRef, kSecUseDataProtectionKeychain };
         const void *values[] = { kSecClassKey, kSecAttrKeyClassPrivate, keyHash, kCFBooleanTrue, kCFBooleanTrue };
         CFRef<CFDictionaryRef> query = CFDictionaryCreate(kCFAllocatorDefault, keys, values,
                                                           sizeof(keys) / sizeof(*keys),
         const void *values[] = { kSecClassKey, kSecAttrKeyClassPrivate, keyHash, kCFBooleanTrue, kCFBooleanTrue };
         CFRef<CFDictionaryRef> query = CFDictionaryCreate(kCFAllocatorDefault, keys, values,
                                                           sizeof(keys) / sizeof(*keys),
@@ -96,7 +96,7 @@ Identity::Identity(const StorageManager::KeychainList &keychains, const SecPoint
             if (CFArrayGetCount(dynamicSearchList)) {
                 // Legacy way is used for dynamic keychains because SmartCards keychain does not support strict CSSM queries which are generated in SecItemCopyMatching
                 // Find a key whose label matches the publicKeyHash of the public key in the certificate.
             if (CFArrayGetCount(dynamicSearchList)) {
                 // Legacy way is used for dynamic keychains because SmartCards keychain does not support strict CSSM queries which are generated in SecItemCopyMatching
                 // Find a key whose label matches the publicKeyHash of the public key in the certificate.
-                KCCursor keyCursor(keychains, CSSM_DL_DB_RECORD_PRIVATE_KEY, NULL);
+                KCCursor keyCursor(keychains, (SecItemClass) CSSM_DL_DB_RECORD_PRIVATE_KEY, NULL);
                 keyCursor->add(CSSM_DB_EQUAL, KeySchema::Label, certificate->publicKeyHash());
 
                 Item key;
                 keyCursor->add(CSSM_DB_EQUAL, KeySchema::Label, certificate->publicKeyHash());
 
                 Item key;
@@ -113,7 +113,7 @@ Identity::Identity(const StorageManager::KeychainList &keychains, const SecPoint
     }
 }
 
     }
 }
 
-Identity::~Identity() throw()
+Identity::~Identity() _NOEXCEPT
 {
     if (mPrivateKey)
         CFRelease(mPrivateKey);
 {
     if (mPrivateKey)
         CFRelease(mPrivateKey);