From 606a417fb2b6ce5d1d112f2f3f710c8085744627 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Wed, 17 Feb 2021 16:15:27 -0500 Subject: Fetch and free cipher and md's Reviewed-by: Richard Levitte Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/14219) --- apps/pkcs12.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/pkcs12.c') diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 8c515870de..e8adeccb5c 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -165,8 +165,8 @@ int pkcs12_main(int argc, char **argv) BIO *in = NULL, *out = NULL; PKCS12 *p12 = NULL; STACK_OF(OPENSSL_STRING) *canames = NULL; - const EVP_CIPHER *const default_enc = EVP_aes_256_cbc(); - const EVP_CIPHER *enc = default_enc; + EVP_CIPHER *default_enc = (EVP_CIPHER *)EVP_aes_256_cbc(); + EVP_CIPHER *enc = (EVP_CIPHER *)default_enc; OPTION_CHOICE o; prog = opt_init(argc, argv, pkcs12_options); @@ -433,7 +433,7 @@ int pkcs12_main(int argc, char **argv) if (key_pbe == NID_undef) key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; if (enc == default_enc) - enc = EVP_des_ede3_cbc(); + enc = (EVP_CIPHER *)EVP_des_ede3_cbc(); if (macalg == NULL) macalg = "sha1"; } @@ -501,7 +501,7 @@ int pkcs12_main(int argc, char **argv) X509 *ee_cert = NULL, *x = NULL; STACK_OF(X509) *certs = NULL; STACK_OF(X509) *untrusted_certs = NULL; - const EVP_MD *macmd = NULL; + EVP_MD *macmd = NULL; unsigned char *catmp = NULL; int i; @@ -679,6 +679,7 @@ int pkcs12_main(int argc, char **argv) export_end: EVP_PKEY_free(key); + EVP_MD_free(macmd); sk_X509_pop_free(certs, X509_free); sk_X509_pop_free(untrusted_certs, X509_free); X509_free(ee_cert); -- cgit v1.2.3-70-g09d2