From 022dbdb8ac07379fa9cc2cbb3eba503b7f77a6ed Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 6 Sep 2016 10:37:31 +0200 Subject: 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. --- lib/vtls/darwinssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/vtls/darwinssl.c') diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c index ebb9e307e..90119dd50 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); -- cgit v1.2.3