I install my app on iPhone6 plus by Hoc,with ios 8.2. "SecPKCS12Import" leak, device log"<Error>: SecTrustEvaluate [leaf AnchorTrusted]",
bug run my app on iPhone6 plus by Xcode,SecPKCS12Import is right,
+ (BOOL)extractIdentity:(SecIdentityRef *)outIdentity andTrust:(SecTrustRef*)outTrust fromPKCS12Data:(NSData *)inPKCS12Data addPassword:(NSString *)password
{
NSDictionary *optionsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:password,kSecImportExportPassphrase, nil];
CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
//<Error>: SecTrustEvaluate [leaf AnchorTrusted]
OSStatus securityError = SecPKCS12Import((__bridge CFDataRef)inPKCS12Data, (__bridge CFDictionaryRef)optionsDictionary, &items);
if (securityError == 0)
{
CFDictionaryRef myIdentityAndTrust = CFArrayGetValueAtIndex (items, 0);
const void *tempIdentity = NULL;
tempIdentity = CFDictionaryGetValue (myIdentityAndTrust, kSecImportItemIdentity);
*outIdentity = (SecIdentityRef)tempIdentity;
const void *tempTrust = NULL;
tempTrust = CFDictionaryGetValue (myIdentityAndTrust, kSecImportItemTrust);
*outTrust = (SecTrustRef)tempTrust;
}
else
{
NSLog(@"Failed with error code %d",(int)securityError);
return NO;
}
return YES;
}