My code is:
FILE * fp = fopen(inputdata, "r");
PKCS12 * p12 = d2i_PKCS12_fp(fp, NULL);
if (p12 == NULL)
{
NSLog(@"Error loading PKCS12 file to p12 \n");
}
if ((ret = PKCS12_verify_mac(p12,"tcs",3))){
lblmsg.text = @"password validated";
NSLog(@"Password validated %s",ppvc_pfxPassPhrase);
}
NSLog(@"ret value %d",ret);
I'm able to load the file to p12, but unable to verify the PKCS12 file. I'm getting 0 as the return from PKCS12_verify_mac
.
Why is it returning 0?