PKCS7_decrypt vs RSA OAEP padding

Michal Moravec michal.moravec at logicworks.cz
Thu Apr 15 15:40:34 UTC 2021


VICTORY!

After replacing the PEM_write_bio_PKCS7/PEM_read_bio_CMS methods for i2d_PKCS7_bio/d2i_CMS_bio https://github.com/EtneteraLogicworks/libscep/commit/b16cd6a97c979abd6ca0ab7af7a944ef553cf17d
PCKS7 (In this case CMS) decryption now works!

Code now looks like:

handle_encrypted_content(SCEP *handle, SCEP_DATA *data, PKCS7 *p7env, X509 *dec_cert, EVP_PKEY *dec_key) {
...
CMS_ContentInfo *cmsMessage = NULL;
BIO *convert = NULL;
conversion = BIO_new(BIO_s_mem());
i2d_PKCS7_bio(conversion, p7env);
cmsEnv = d2i_CMS_bio(conversion, NULL);
CMS_decrypt(cmsEnv, dec_key, dec_cert, NULL, decData, 0);

MM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20210415/489a53a9/attachment.html>


More information about the openssl-users mailing list