aboutsummaryrefslogtreecommitdiff
path: root/crypto/cms/cms_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cms/cms_enc.c')
-rw-r--r--crypto/cms/cms_enc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c
index fc490303d4c6..6f077b339a87 100644
--- a/crypto/cms/cms_enc.c
+++ b/crypto/cms/cms_enc.c
@@ -68,7 +68,12 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
if (enc) {
int ivlen;
+
calg->algorithm = OBJ_nid2obj(EVP_CIPHER_CTX_type(ctx));
+ if (calg->algorithm == NULL) {
+ CMSerr(ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM);
+ goto err;
+ }
/* Generate a random IV if we need one */
ivlen = EVP_CIPHER_CTX_iv_length(ctx);
if (ivlen > 0) {