]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/lib/SecKey.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / SecKey.cpp
index 1495ca1dc7a5266d2abbcc72720fb018f511170f..940caae2b85a5b5477e2b3edb50bf79a18ee52cc 100644 (file)
@@ -804,20 +804,19 @@ static Boolean SecCDSAKeySetParameter(SecKeyRef key, CFStringRef name, CFPropert
 const SecKeyDescriptor kSecCDSAKeyDescriptor = {
     .version = kSecKeyDescriptorVersion,
     .name = "CDSAKey",
+    .extraBytes = (sizeof(class CDSASecKey) > sizeof(struct __SecKey) ? (sizeof(class CDSASecKey) - sizeof(struct __SecKey)) : 0),
 
     .init = SecCDSAKeyInit,
     .destroy = SecCDSAKeyDestroy,
     .blockSize = SecCDSAKeyGetBlockSize,
-    .getAlgorithmID = SecCDSAKeyGetAlgorithmId,
     .copyDictionary = SecCDSAKeyCopyAttributeDictionary,
+    .getAlgorithmID = SecCDSAKeyGetAlgorithmId,
     .copyPublic = SecCDSAKeyCopyPublicBytes,
     .copyExternalRepresentation = SecCDSAKeyCopyExternalRepresentation,
     .copyPublicKey = SecCDSAKeyCopyPublicKey,
     .copyOperationResult = SecCDSAKeyCopyOperationResult,
     .isEqual = SecCDSAKeyIsEqual,
     .setParameter = SecCDSAKeySetParameter,
-
-    .extraBytes = (sizeof(class CDSASecKey) > sizeof(struct __SecKey) ? (sizeof(class CDSASecKey) - sizeof(struct __SecKey)) : 0),
 };
 
 namespace Security {
@@ -863,9 +862,9 @@ namespace Security {
                             }
                         }
                     } else {
-                        cdsaKey = SecKeyCreateFromData(keyAttributes, keyData, NULL);
+                        cdsaKey.take(SecKeyCreateFromData(keyAttributes, keyData, NULL));
                         if (cdsaKey) {
-                            SecKeySetAuxilliaryCDSAKeyForKey(key, cdsaKey.retain());
+                            SecKeySetAuxilliaryCDSAKeyForKey(key, cdsaKey.get());
                         }
                     }
                 }