]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/regressions/kc-24-key-copy-keychains.c
Security-58286.260.20.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / regressions / kc-24-key-copy-keychains.c
index 2797dc6f144304bcd4f3f26a267587c3e1f3b587..f0342a965b166ac1b12790e89d19423f649875bb 100644 (file)
@@ -76,7 +76,7 @@ static OSStatus GenerateRSAKeyPair(
        CFDictionaryAddValue( params, kSecUseKeychain, keychain );
        CFDictionaryAddValue( params, kSecAttrAccess, access );
        CFDictionaryAddValue( params, kSecAttrKeyType, kSecAttrKeyTypeRSA );
-       CFDictionaryAddValue( params, kSecAttrKeySizeInBits, keySize );
+    CFDictionaryAddValue( params, kSecAttrKeySizeInBits, keySize ); CFReleaseNull(keySize);
     CFDictionaryAddValue( params, kSecAttrIsPermanent, kCFBooleanTrue );
 
        if (extractable)
@@ -208,7 +208,7 @@ static int testCopyKey(SecKeychainRef userKeychain, SecKeychainRef tempKeychain)
     ok_status(status, "%s: SecItemExport", testName);
 
        if (!exportedData || status != noErr) {
-               warnc(EXIT_FAILURE, "Unable to export key! (error %d)", (int)status);
+               errx(EXIT_FAILURE, "Unable to export key! (error %d)", (int)status);
        }
 
        // set up an explicit access control instance for the imported key
@@ -258,7 +258,7 @@ static int testCopyKey(SecKeychainRef userKeychain, SecKeychainRef tempKeychain)
        }
 
     // ensure that key was copied, and its label changed
-    checkN(testName, makeQueryKeyDictionaryWithLabel(userKeychain, kSecAttrKeyClassPrivate, label), 1);
+    checkN(testName, createQueryKeyDictionaryWithLabel(userKeychain, kSecAttrKeyClassPrivate, label), 1);
 
        if (access) CFRelease(access);