1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

darwinssl: test for errSecSuccess in PKCS12 import rather than noErr (#993)

While noErr and errSecSuccess are defined as the same value, the API
documentation states that SecPKCS12Import() returns errSecSuccess if
there were no errors in importing. Ensure that a future change of the
defined value doesn't break (however unlikely) and be consistent with
the API docs.
This commit is contained in:
Daniel Gustafsson 2016-09-06 10:37:31 +02:00 committed by Daniel Stenberg
parent 8331b08d22
commit 022dbdb8ac

View File

@ -955,7 +955,7 @@ static OSStatus CopyIdentityFromPKCS12File(const char *cPath,
/* Here we go: */ /* Here we go: */
status = SecPKCS12Import(pkcs_data, options, &items); status = SecPKCS12Import(pkcs_data, options, &items);
if(status == noErr && items && CFArrayGetCount(items)) { if(status == errSecSuccess && items && CFArrayGetCount(items)) {
CFDictionaryRef identity_and_trust = CFArrayGetValueAtIndex(items, 0L); CFDictionaryRef identity_and_trust = CFArrayGetValueAtIndex(items, 0L);
const void *temp_identity = CFDictionaryGetValue(identity_and_trust, const void *temp_identity = CFDictionaryGetValue(identity_and_trust,
kSecImportItemIdentity); kSecImportItemIdentity);