Commit 708cf5de 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>
parent ec5b56f3
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -175,7 +175,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);
@@ -191,6 +191,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
            ASN1_TYPE_free(calg->parameter);
            calg->parameter = NULL;
        }
    }
    ok = 1;

 err: