Hi I am trying to use CMS_decrypt() , but it is returning 0 , which is failure . On printing openssl error it is returning 0 .
below is what have tried .
in = BIO_new_file("cms_encrypted_output.txt", "r");
if (NULL == in) {
printf("BIO new license file failed");
}
cms = d2i_CMS_bio(in , NULL);
if (NULL == cms) {
printf("d2i_CMS_bio license file failed");
}
/* Decrypt S/MIME message */
if(!CMS_decrypt(cms, rkey, rcert, NULL, out, 0)){
printf("openssl error [%s], ERR_error_string(ERR_get_error(), NULL));
printf("CMS_decrypt failed");
}
below is the output : openssl error :: error:00000000:lib(0):func(0):reason(0) CMS_decrypt failed