mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Add ossl_ conf symbols
Partial fix for #12964 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14473)
This commit is contained in:
parent
054d43ff97
commit
f148f7034c
@ -244,7 +244,7 @@ COMP_METHOD *COMP_zlib(void)
|
|||||||
zlib_loaded++;
|
zlib_loaded++;
|
||||||
|
|
||||||
if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {
|
if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {
|
||||||
comp_zlib_cleanup_int();
|
ossl_comp_zlib_cleanup();
|
||||||
return meth;
|
return meth;
|
||||||
}
|
}
|
||||||
if (zlib_loaded)
|
if (zlib_loaded)
|
||||||
@ -259,7 +259,7 @@ COMP_METHOD *COMP_zlib(void)
|
|||||||
return meth;
|
return meth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void comp_zlib_cleanup_int(void)
|
void ossl_comp_zlib_cleanup(void)
|
||||||
{
|
{
|
||||||
#ifdef ZLIB_SHARED
|
#ifdef ZLIB_SHARED
|
||||||
DSO_free(zlib_dso);
|
DSO_free(zlib_dso);
|
||||||
|
@ -7,5 +7,4 @@
|
|||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void conf_add_ssl_module(void);
|
void ossl_config_add_ssl_module(void);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ void OPENSSL_load_builtin_modules(void)
|
|||||||
ENGINE_add_conf_module();
|
ENGINE_add_conf_module();
|
||||||
#endif
|
#endif
|
||||||
EVP_add_alg_module();
|
EVP_add_alg_module();
|
||||||
conf_add_ssl_module();
|
ossl_config_add_ssl_module();
|
||||||
ossl_provider_add_conf_module();
|
ossl_provider_add_conf_module();
|
||||||
ossl_random_add_conf_module();
|
ossl_random_add_conf_module();
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ int CONF_module_add(const char *name, conf_init_func *ifunc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void conf_modules_free_int(void)
|
void ossl_config_modules_free(void)
|
||||||
{
|
{
|
||||||
CONF_modules_finish();
|
CONF_modules_finish();
|
||||||
CONF_modules_unload(1);
|
CONF_modules_unload(1);
|
||||||
|
@ -40,7 +40,7 @@ void OPENSSL_config(const char *appname)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int openssl_config_int(const OPENSSL_INIT_SETTINGS *settings)
|
int ossl_config_int(const OPENSSL_INIT_SETTINGS *settings)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
@ -55,7 +55,7 @@ int openssl_config_int(const OPENSSL_INIT_SETTINGS *settings)
|
|||||||
flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
|
flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
|
||||||
|
|
||||||
#ifdef OPENSSL_INIT_DEBUG
|
#ifdef OPENSSL_INIT_DEBUG
|
||||||
fprintf(stderr, "OPENSSL_INIT: openssl_config_int(%s, %s, %lu)\n",
|
fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
|
||||||
filename, appname, flags);
|
filename, appname, flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ int openssl_config_int(const OPENSSL_INIT_SETTINGS *settings)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void openssl_no_config_int(void)
|
void ossl_no_config_int(void)
|
||||||
{
|
{
|
||||||
openssl_configured = 1;
|
openssl_configured = 1;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr,
|
|||||||
*arg = cmd[idx].arg;
|
*arg = cmd[idx].arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void conf_add_ssl_module(void)
|
void ossl_config_add_ssl_module(void)
|
||||||
{
|
{
|
||||||
CONF_module_add("ssl_conf", ssl_module_init, ssl_module_free);
|
CONF_module_add("ssl_conf", ssl_module_init, ssl_module_free);
|
||||||
}
|
}
|
||||||
|
@ -235,22 +235,22 @@ static int config_inited = 0;
|
|||||||
static const OPENSSL_INIT_SETTINGS *conf_settings = NULL;
|
static const OPENSSL_INIT_SETTINGS *conf_settings = NULL;
|
||||||
DEFINE_RUN_ONCE_STATIC(ossl_init_config)
|
DEFINE_RUN_ONCE_STATIC(ossl_init_config)
|
||||||
{
|
{
|
||||||
int ret = openssl_config_int(NULL);
|
int ret = ossl_config_int(NULL);
|
||||||
|
|
||||||
config_inited = 1;
|
config_inited = 1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_config_settings, ossl_init_config)
|
DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_config_settings, ossl_init_config)
|
||||||
{
|
{
|
||||||
int ret = openssl_config_int(conf_settings);
|
int ret = ossl_config_int(conf_settings);
|
||||||
|
|
||||||
config_inited = 1;
|
config_inited = 1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_config, ossl_init_config)
|
DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_config, ossl_init_config)
|
||||||
{
|
{
|
||||||
OSSL_TRACE(INIT, "openssl_no_config_int()\n");
|
OSSL_TRACE(INIT, "ossl_no_config_int()\n");
|
||||||
openssl_no_config_int();
|
ossl_no_config_int();
|
||||||
config_inited = 1;
|
config_inited = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -385,8 +385,8 @@ void OPENSSL_cleanup(void)
|
|||||||
|
|
||||||
#ifndef OPENSSL_NO_COMP
|
#ifndef OPENSSL_NO_COMP
|
||||||
if (zlib_inited) {
|
if (zlib_inited) {
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: comp_zlib_cleanup_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
|
||||||
comp_zlib_cleanup_int();
|
ossl_comp_zlib_cleanup();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -406,16 +406,16 @@ void OPENSSL_cleanup(void)
|
|||||||
* must be called before engine_cleanup_int()
|
* must be called before engine_cleanup_int()
|
||||||
* - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
|
* - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
|
||||||
* before the ex data handlers are wiped during default ossl_lib_ctx deinit.
|
* before the ex data handlers are wiped during default ossl_lib_ctx deinit.
|
||||||
* - conf_modules_free_int() can end up in ENGINE code so must be called
|
* - ossl_config_modules_free() can end up in ENGINE code so must be called
|
||||||
* before engine_cleanup_int()
|
* before engine_cleanup_int()
|
||||||
* - ENGINEs and additional EVP algorithms might use added OIDs names so
|
* - ENGINEs and additional EVP algorithms might use added OIDs names so
|
||||||
* obj_cleanup_int() must be called last
|
* ossl_obj_cleanup_int() must be called last
|
||||||
*/
|
*/
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
|
||||||
ossl_rand_cleanup_int();
|
ossl_rand_cleanup_int();
|
||||||
|
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: conf_modules_free_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
|
||||||
conf_modules_free_int();
|
ossl_config_modules_free();
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
|
||||||
@ -438,8 +438,8 @@ void OPENSSL_cleanup(void)
|
|||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
|
||||||
evp_cleanup_int();
|
evp_cleanup_int();
|
||||||
|
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: obj_cleanup_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
|
||||||
obj_cleanup_int();
|
ossl_obj_cleanup_int();
|
||||||
|
|
||||||
OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
|
OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
|
||||||
err_cleanup();
|
err_cleanup();
|
||||||
|
@ -150,7 +150,7 @@ static void cleanup3_doall(ADDED_OBJ *a)
|
|||||||
OPENSSL_free(a);
|
OPENSSL_free(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
void obj_cleanup_int(void)
|
void ossl_obj_cleanup_int(void)
|
||||||
{
|
{
|
||||||
if (added == NULL)
|
if (added == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
#include <openssl/objects.h>
|
#include <openssl/objects.h>
|
||||||
|
|
||||||
void obj_cleanup_int(void);
|
void ossl_obj_cleanup_int(void);
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
#include <openssl/comp.h>
|
#include <openssl/comp.h>
|
||||||
|
|
||||||
void comp_zlib_cleanup_int(void);
|
void ossl_comp_zlib_cleanup(void);
|
||||||
|
@ -24,8 +24,8 @@ struct ossl_init_settings_st {
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int openssl_config_int(const OPENSSL_INIT_SETTINGS *);
|
int ossl_config_int(const OPENSSL_INIT_SETTINGS *);
|
||||||
void openssl_no_config_int(void);
|
void ossl_no_config_int(void);
|
||||||
void conf_modules_free_int(void);
|
void ossl_config_modules_free(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user