From ecbe8166cd8e6f15280b6d03fb75d95a16c4f2a8 Mon Sep 17 00:00:00 2001 From: Oliver Letterer Date: Mon, 8 Apr 2013 14:04:08 +0200 Subject: [PATCH] Now using errSecSuccess instead of noErr for Security frameworks OSStatus. --- AFNetworking/AFURLConnectionOperation.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index f854488..69c8870 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -216,11 +216,11 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat SecPolicyRef policy = SecPolicyCreateBasicX509(); SecTrustRef allowedTrust = NULL; OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &allowedTrust); - NSAssert(status == noErr, @"SecTrustCreateWithCertificates error: %ld", (long int)status); + NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status); SecTrustResultType result = 0; status = SecTrustEvaluate(allowedTrust, &result); - NSAssert(status == noErr, @"SecTrustEvaluate error: %ld", (long int)status); + NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status); SecKeyRef allowedPublicKey = SecTrustCopyPublicKey(allowedTrust); NSCParameterAssert(allowedPublicKey); @@ -565,11 +565,11 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe SecTrustRef trust = NULL; OSStatus status = SecTrustCreateWithCertificates(certificates, policy, &trust); - NSAssert(status == noErr, @"SecTrustCreateWithCertificates error: %ld", (long int)status); + NSAssert(status == errSecSuccess, @"SecTrustCreateWithCertificates error: %ld", (long int)status); SecTrustResultType result; status = SecTrustEvaluate(trust, &result); - NSAssert(status == noErr, @"SecTrustEvaluate error: %ld", (long int)status); + NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status); [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; @@ -612,7 +612,7 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe #else SecTrustResultType result = 0; OSStatus status = SecTrustEvaluate(serverTrust, &result); - NSAssert(status == noErr, @"SecTrustEvaluate error: %ld", (long int)status); + NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status); if (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed) { NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];