]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/regressions/kc-12-key-create-symmetric-and-use.m
Security-58286.260.20.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / regressions / kc-12-key-create-symmetric-and-use.m
index 3cbfec92765351adced69ada6673919cafb844b5..d5b37eedabd719849a73757e783c6f4f7f1c61b4 100644 (file)
@@ -97,7 +97,7 @@ static SecAccessRef createAccess(SecKeychainItemRef item, NSString *accessLabel,
         ok_status(err, "%s: SecTrustedApplicationCreateFromPath (1)", testName);
         err = SecTrustedApplicationCreateFromPath("/Applications/Safari.app", &someOther);
         ok_status(err, "%s: SecTrustedApplicationCreateFromPath (2)", testName);
         ok_status(err, "%s: SecTrustedApplicationCreateFromPath (1)", testName);
         err = SecTrustedApplicationCreateFromPath("/Applications/Safari.app", &someOther);
         ok_status(err, "%s: SecTrustedApplicationCreateFromPath (2)", testName);
-        trustedApplications = [NSArray arrayWithObjects:(id)myself, (id)someOther, nil];
+        trustedApplications = [NSArray arrayWithObjects:(__bridge_transfer id)myself, (__bridge_transfer id)someOther, nil];
     }
 
     // If the keychain item already exists, use its access reference; otherwise, create a new one
     }
 
     // If the keychain item already exists, use its access reference; otherwise, create a new one
@@ -137,7 +137,7 @@ static SecKeyRef findExistingEncryptionKey(SecKeychainRef kc)
     return nullptr;
 }
 
     return nullptr;
 }
 
-static SecKeyRef generateEncryptionKey(SecKeychainRef kc)
+static CF_RETURNS_RETAINED SecKeyRef generateEncryptionKey(SecKeychainRef kc)
 {
     SecAccessRef access = createAccess(nil, EncryptionKeyLabel, false);
     if (!access) {
 {
     SecAccessRef access = createAccess(nil, EncryptionKeyLabel, false);
     if (!access) {
@@ -242,7 +242,7 @@ int kc_12_key_create_symmetric_and_use(int argc, char *const *argv)
         if (encryptedData) {
             NSData *roundtrippedData = decryptData(kc, encryptedData);
 
         if (encryptedData) {
             NSData *roundtrippedData = decryptData(kc, encryptedData);
 
-            eq_cf(roundtrippedData, data, "%s: Round-tripped data does not match original data", testName);
+            eq_cf((__bridge CFTypeRef) roundtrippedData, (__bridge CFTypeRef) data, "%s: Round-tripped data does not match original data", testName);
             NSLog(@"Decrypted: %@", roundtrippedData);
         }
     }
             NSLog(@"Decrypted: %@", roundtrippedData);
         }
     }