X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b54c578e17e9bcbd74aa30ea75e25e955b9a6205..refs/heads/master:/OSX/libsecurity_keychain/lib/SecKey.cpp diff --git a/OSX/libsecurity_keychain/lib/SecKey.cpp b/OSX/libsecurity_keychain/lib/SecKey.cpp index 1495ca1d..940caae2 100644 --- a/OSX/libsecurity_keychain/lib/SecKey.cpp +++ b/OSX/libsecurity_keychain/lib/SecKey.cpp @@ -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()); } } }