Skip to content

Commit

Permalink
lower deployment versions, fix misc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-dt committed Apr 27, 2023
1 parent f5d8563 commit e3a11e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions TrustKit.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Pod::Spec.new do |s|
s.name = "TrustKit"
s.version = "3.0.0"
s.version = "3.0.2"
s.summary = 'TrustKit is an open source framework that makes it easy to deploy SSL pinning in any iOS, macOS, tvOS or watchOS App.'
s.homepage = "https://datatheorem.github.io/TrustKit"
s.documentation_url = 'https://datatheorem.github.io/TrustKit/documentation/'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.authors = 'Alban Diquet', 'Angela Chow', 'Eric Castro'
s.source = { :git => "https://github.com/datatheorem/TrustKit.git", :tag => "#{s.version}" }

s.ios.deployment_target = '14.0'
s.osx.deployment_target = '11.0'
s.tvos.deployment_target = '14.0'
s.watchos.deployment_target = '7.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '4.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.source_files = ['TrustKit', 'TrustKit/**/*.{h,m,c}']
Expand Down
22 changes: 12 additions & 10 deletions TrustKit/Pinning/pinning_utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ void evaluateCertificateChainTrust(SecTrustRef serverTrust, SecTrustResultType *
CFErrorRef errorRef;
bool certificateEvaluationSucceeded = SecTrustEvaluateWithError(serverTrust, &errorRef);
OSStatus status = SecTrustGetTrustResult(serverTrust, trustResult);
if (status != errSecSuccess)
{
certificateEvaluationSucceeded = false;
NSString *errDescription = [NSString stringWithFormat:@"got status %d", status];
*error = [[NSError alloc] initWithDomain:@"com.datatheorem.trustkit" code:1 userInfo:@{NSLocalizedDescriptionKey:errDescription}];
}
else if (!certificateEvaluationSucceeded && (error != NULL))
{
*error = (__bridge_transfer NSError *)errorRef;
if (error != NULL) {
if (status != errSecSuccess)
{
certificateEvaluationSucceeded = false;
NSString *errDescription = [NSString stringWithFormat:@"got status %d", (int)status];
*error = [[NSError alloc] initWithDomain:@"com.datatheorem.trustkit" code:1 userInfo:@{NSLocalizedDescriptionKey:errDescription}];
}
else if (!certificateEvaluationSucceeded)
{
*error = (__bridge_transfer NSError *)errorRef;
}
}
}
else
Expand All @@ -37,7 +39,7 @@ void evaluateCertificateChainTrust(SecTrustRef serverTrust, SecTrustResultType *
OSStatus status = SecTrustEvaluate(serverTrust, trustResult);
#pragma clang diagnostic pop
if (status != errSecSuccess && (error != NULL)) {
NSString *errDescription = [NSString stringWithFormat:@"got status %d", status];
NSString *errDescription = [NSString stringWithFormat:@"got status %d", (int)status];
*error = [[NSError alloc] initWithDomain:@"com.datatheorem.trustkit" code:2 userInfo:@{NSLocalizedDescriptionKey:errDescription}];
}
}
Expand Down

0 comments on commit e3a11e0

Please sign in to comment.