From 246e09319c1d2a8140ffe1e5aeb1be26015696f0 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 28 Mar 2006 17:23:48 +0000 Subject: Fix bug where freed OIDs could be accessed in EVP_cleanup() by defering freeing in OBJ_cleanup(). --- apps/apps.h | 4 ++-- apps/dgst.c | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/apps.h b/apps/apps.h index f7950d7a97..7a20d066c9 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -177,7 +177,7 @@ extern BIO *bio_err; ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) # define apps_shutdown() \ do { CONF_modules_unload(1); destroy_ui_method(); \ - EVP_cleanup(); ENGINE_cleanup(); \ + OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \ ERR_free_strings(); } while(0) # else @@ -187,7 +187,7 @@ extern BIO *bio_err; setup_ui_method(); } while(0) # define apps_shutdown() \ do { CONF_modules_unload(1); destroy_ui_method(); \ - EVP_cleanup(); \ + OBJ_cleanup(); EVP_cleanup(); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \ ERR_free_strings(); } while(0) # endif diff --git a/apps/dgst.c b/apps/dgst.c index 65b2ae34ba..0c9c351ebc 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -180,6 +180,7 @@ int MAIN(int argc, char **argv) { if (--argc < 1) break; engine= *(++argv); + e = setup_engine(bio_err, engine, 0); } #endif else if (strcmp(*argv,"-hex") == 0) @@ -257,10 +258,6 @@ int MAIN(int argc, char **argv) goto end; } -#ifndef OPENSSL_NO_ENGINE - e = setup_engine(bio_err, engine, 0); -#endif - in=BIO_new(BIO_s_file()); bmd=BIO_new(BIO_f_md()); if (debug) -- cgit v1.2.3