File tree 1 file changed +2
-7
lines changed
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -107,16 +107,11 @@ const char *getExpirationDate(long *expirationDate) {
107
107
(id)kSecReturnRef: @YES,
108
108
};
109
109
110
- OSStatus err = noErr;
111
110
SecCertificateRef cert = NULL;
112
111
113
112
// Search the keychain for certificates matching the query above.
114
- err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert);
115
- if (err != noErr){
116
- NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err];
117
- NSLog(@"%@", errString);
118
- return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]];
119
- }
113
+ OSStatus err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert);
114
+ if (err != noErr) return toErrorString([@"Error getting the certificate: " stringByAppendingFormat:@"%d", err]);
120
115
121
116
// Get data from the certificate, as a dictionary of properties. We just need the "invalidity not after" property.
122
117
CFDictionaryRef certDict = SecCertificateCopyValues(cert,
You can’t perform that action at this time.
0 commit comments