]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
darwinssl: test for errSecSuccess in PKCS12 import rather than noErr (#993)
authorDaniel Gustafsson <daniel@hobbit.se>
Tue, 6 Sep 2016 08:37:31 +0000 (10:37 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 6 Sep 2016 08:37:31 +0000 (10:37 +0200)
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.

lib/vtls/darwinssl.c

index ebb9e307e9ddcac39f5000f0acb4cd3a5ee82ca6..90119dd50dde8c39ffe8b8c618a9f8d1c0ed1d9e 100644 (file)
@@ -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);