diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-04 18:00:04 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-13 09:52:33 +0200 |
commit | cbf6959fe8ff51730a397ea426075d547ec5d7a8 (patch) | |
tree | eef161225ca88ad3d6471c81c942dc6c7f3a26df | |
parent | Deprecate ENGINE_cleanup() and make it a no-op (diff) | |
download | openssl-cbf6959fe8ff51730a397ea426075d547ec5d7a8.tar.xz openssl-cbf6959fe8ff51730a397ea426075d547ec5d7a8.zip |
Deprecate CONF_modules_free() and make it a no-op
CONF_modules_free() should not be called expicitly - we should leave
auto-deinit to clean this up instead.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r-- | crypto/conf/conf_mod.c | 4 | ||||
-rw-r--r-- | crypto/init.c | 8 | ||||
-rw-r--r-- | doc/crypto/CONF_modules_free.pod | 17 | ||||
-rw-r--r-- | doc/crypto/OPENSSL_config.pod | 6 | ||||
-rw-r--r-- | include/internal/conf.h | 1 | ||||
-rw-r--r-- | include/openssl/conf.h | 4 |
6 files changed, 25 insertions, 15 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index aede656045..99f552ce61 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -60,7 +60,7 @@ #include <ctype.h> #include <openssl/crypto.h> #include "internal/cryptlib.h" -#include <openssl/conf.h> +#include "internal/conf.h" #include "internal/dso.h" #include <openssl/x509.h> @@ -460,7 +460,7 @@ int CONF_module_add(const char *name, conf_init_func *ifunc, return 0; } -void CONF_modules_free(void) +void conf_modules_free_intern(void) { CONF_modules_finish(); CONF_modules_unload(1); diff --git a/crypto/init.c b/crypto/init.c index ca19408bef..f5473ecfe3 100644 --- a/crypto/init.c +++ b/crypto/init.c @@ -457,7 +457,7 @@ void OPENSSL_cleanup(void) fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: " "rand_cleanup_intern()\n"); fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: " - "CONF_modules_free()\n"); + "conf_modules_free_intern()\n"); #ifndef OPENSSL_NO_ENGINE fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: " "engine_cleanup_intern()\n"); @@ -477,11 +477,11 @@ void OPENSSL_cleanup(void) * must be called before engine_cleanup_intern() * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up * before the ex data handlers are wiped in CRYPTO_cleanup_all_ex_data(). - * - CONF_modules_free() can end up in ENGINE code so must be called before - * engine_cleanup_intern() + * - conf_modules_free_intern() can end up in ENGINE code so must be called + * before engine_cleanup_intern() */ rand_cleanup_intern(); - CONF_modules_free(); + conf_modules_free_intern(); #ifndef OPENSSL_NO_ENGINE engine_cleanup_intern(); #endif diff --git a/doc/crypto/CONF_modules_free.pod b/doc/crypto/CONF_modules_free.pod index 37a7b16000..12e594dace 100644 --- a/doc/crypto/CONF_modules_free.pod +++ b/doc/crypto/CONF_modules_free.pod @@ -9,10 +9,15 @@ #include <openssl/conf.h> - void CONF_modules_free(void); void CONF_modules_finish(void); void CONF_modules_unload(int all); +Deprecated: + + #if OPENSSL_API_COMPAT < 0x10100000L + # define CONF_modules_free() + #endif + =head1 DESCRIPTION CONF_modules_free() closes down and frees up all memory allocated by all @@ -27,8 +32,10 @@ B<all> is B<1> all modules, including builtin modules will be unloaded. =head1 NOTES -Normally applications will only call CONF_modules_free() at application to -tidy up any configuration performed. +Normally in versions of OpenSSL prior to 1.1.0 applications will only call +CONF_modules_free() at application to tidy up any configuration performed. From +1.1.0 CONF_modules_free() is deprecated an no explicit CONF cleanup as required +at all. For more information see L<OPENSSL_init_crypto(3)>. =head1 RETURN VALUE @@ -39,4 +46,8 @@ None of the functions return a value. L<conf(5)>, L<OPENSSL_config(3)>, L<CONF_modules_load_file(3)> +=head1 HISTORY + +CONF_modules_free() was deprecated in OpenSSL 1.1.0. + =cut diff --git a/doc/crypto/OPENSSL_config.pod b/doc/crypto/OPENSSL_config.pod index 4c82566097..77061a00ce 100644 --- a/doc/crypto/OPENSSL_config.pod +++ b/doc/crypto/OPENSSL_config.pod @@ -23,9 +23,6 @@ Multiple calls have no effect. OPENSSL_no_config() disables configuration. If called before OPENSSL_config() no configuration takes place. -Applications should free up configuration at application closedown by calling -CONF_modules_free(). - If the application is built with B<OPENSSL_LOAD_CONF> defined, then a call to OpenSSL_add_all_algorithms() will implicitly call OPENSSL_config() first. @@ -57,8 +54,7 @@ Neither OPENSSL_config() nor OPENSSL_no_config() return a value. =head1 SEE ALSO L<conf(5)>, -L<CONF_modules_load_file(3)>, -L<CONF_modules_free(3)> +L<CONF_modules_load_file(3)> =head1 HISTORY diff --git a/include/internal/conf.h b/include/internal/conf.h index 3bd6069a59..e21f22f9d0 100644 --- a/include/internal/conf.h +++ b/include/internal/conf.h @@ -53,6 +53,7 @@ struct ossl_init_settings_st { void openssl_config_internal(const char *config_name); void openssl_no_config_internal(void); +void conf_modules_free_intern(void); #ifdef __cplusplus } diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 24e9dee49f..29189d0547 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -186,7 +186,9 @@ int CONF_modules_load_file(const char *filename, const char *appname, unsigned long flags); void CONF_modules_unload(int all); void CONF_modules_finish(void); -void CONF_modules_free(void); +#if OPENSSL_API_COMPAT < 0x10100000L +# define CONF_modules_free() +#endif int CONF_module_add(const char *name, conf_init_func *ifunc, conf_finish_func *ffunc); |