summaryrefslogtreecommitdiffstats
path: root/apps/smime.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-17 16:15:27 -0500
committerDmitry Belyavskiy <beldmit@gmail.com>2021-04-20 10:12:29 +0200
commit606a417fb2b6ce5d1d112f2f3f710c8085744627 (patch)
tree332af9e08a75b5f628f6786300d6ee43a816e964 /apps/smime.c
parentc39352e4e4952a9f4b2171134af0e015a4d40768 (diff)
Fetch and free cipher and md's
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/14219)
Diffstat (limited to 'apps/smime.c')
-rw-r--r--apps/smime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/smime.c b/apps/smime.c
index 98a2f32b4a..ed12b92193 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -140,8 +140,8 @@ int smime_main(int argc, char **argv)
X509 *cert = NULL, *recip = NULL, *signer = NULL;
X509_STORE *store = NULL;
X509_VERIFY_PARAM *vpm = NULL;
- const EVP_CIPHER *cipher = NULL;
- const EVP_MD *sign_md = NULL;
+ EVP_CIPHER *cipher = NULL;
+ EVP_MD *sign_md = NULL;
const char *CAfile = NULL, *CApath = NULL, *CAstore = NULL, *prog = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile = NULL;
char *infile = NULL, *outfile = NULL, *signerfile = NULL, *recipfile = NULL;
@@ -439,7 +439,7 @@ int smime_main(int argc, char **argv)
if (operation == SMIME_ENCRYPT) {
if (cipher == NULL) {
#ifndef OPENSSL_NO_DES
- cipher = EVP_des_ede3_cbc();
+ cipher = (EVP_CIPHER *)EVP_des_ede3_cbc();
#else
BIO_printf(bio_err, "No cipher selected\n");
goto end;
@@ -662,6 +662,8 @@ int smime_main(int argc, char **argv)
X509_free(recip);
X509_free(signer);
EVP_PKEY_free(key);
+ EVP_MD_free(sign_md);
+ EVP_CIPHER_free(cipher);
PKCS7_free(p7);
release_engine(e);
BIO_free(in);