Commit 6e216ba6 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Only set CMS parameter when encrypting



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(cherry picked from commit 708cf5de)
parent 0c4465ed
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
               CMS_R_CIPHER_INITIALISATION_ERROR);
        goto err;
    }

    if (enc) {
        calg->parameter = ASN1_TYPE_new();
        if (calg->parameter == NULL) {
            CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, ERR_R_MALLOC_FAILURE);
@@ -195,6 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
            ASN1_TYPE_free(calg->parameter);
            calg->parameter = NULL;
        }
    }
    ok = 1;

 err: