cengineer
unread,Jan 25, 2017, 10:28:52 AM1/25/17You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi all,
I am trying to verify PKCS7 signature in C. I am use PKCS_signatureVerify(). However, an error is occured.
The error:
"140736204891696:error:21071065:PKCS7 routines:PKCS7_signatureVerify:digest failure:pk7_doit.c:1106"
The source:
...
BIO * p7Bio = NULL;
//Signer certificate
X509 * certificate = ...
p7Bio=PKCS7_dataInit(pkcs7,NULL);
//Fetch signer info from pkcs7
STACK_OF(PKCS7_SIGNER_INFO) * signerInfoStack = PKCS7_get_signer_info(pkcs7);
int numberOfSignerInfo = sk_PKCS7_SIGNER_INFO_num(signerInfoStack);
for (int i=0; i<numberOfSignerInfo; ++i)
{
PKCS7_SIGNER_INFO * signerInfo = sk_PKCS7_SIGNER_INFO_value(signerInfoStack, i);
int verificationResult = PKCS7_signatureVerify(p7Bio, pkcs7, signerInfo, certificate);
}
...
Anyone have advice on how to solve verification problem?