Call RAND_cleanup in openssl application.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 28 Mar 2013 14:28:06 +0000 (14:28 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 28 Mar 2013 14:29:11 +0000 (14:29 +0000)
(cherry picked from commit 944bc29f9004cf8851427ebfa83ee70b8399da57)

apps/apps.h
apps/openssl.c

index 6a71b8323a1a9b2a39ebd39a773c59597dfabea5..954c33afed9ab2d034f9a4a74aed3766cb19f050 100644 (file)
@@ -183,11 +183,13 @@ extern BIO *bio_err;
 #    define apps_startup() \
                        do { do_pipe_sig(); CRYPTO_malloc_init(); \
                        ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
+                       RAND_cleanup(); \
                        ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
 #    define apps_shutdown() \
                        do { CONF_modules_unload(1); destroy_ui_method(); \
                        OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
                        CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
+                       RAND_cleanup(); \
                        ERR_free_strings(); zlib_cleanup();} while(0)
 #  else
 #    define apps_startup() \
index 1c880d90ba1d142416ca8d1cbd16668be0a8aec8..71e1e48ece40579234bf4578c2d2b02b6fc40b3c 100644 (file)
 #include "apps.h"
 #include <openssl/bio.h>
 #include <openssl/crypto.h>
+#include <openssl/rand.h>
 #include <openssl/lhash.h>
 #include <openssl/conf.h>
 #include <openssl/x509.h>