From: Daniel Gustafsson Date: Tue, 6 Sep 2016 08:37:31 +0000 (+0200) Subject: darwinssl: test for errSecSuccess in PKCS12 import rather than noErr (#993) X-Git-Tag: curl-7_50_2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=022dbdb8ac07379fa9cc2cbb3eba503b7f77a6ed;p=thirdparty%2Fcurl.git 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. --- diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c index ebb9e307e9..90119dd50d 100644 --- a/lib/vtls/darwinssl.c +++ b/lib/vtls/darwinssl.c @@ -955,7 +955,7 @@ static OSStatus CopyIdentityFromPKCS12File(const char *cPath, /* Here we go: */ 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); const void *temp_identity = CFDictionaryGetValue(identity_and_trust, kSecImportItemIdentity);