diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-03-20 20:25:39 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-03-20 20:25:39 +1000 |
commit | 22e27978b29b2cdc1db79659ed653d6cf31834ab (patch) | |
tree | f156d63b1f889794d723167e59108d088fbe5907 /include | |
parent | 0f2deef59d13e852a4bde0e853e9b49bab51a108 (diff) |
Add support for passing the libctx to the config loader
The self tests for the fips module are triggered on startup and they need to know the
core's libctx in order to function correctly. As the provider can be autoloaded via configuration
it then needs to propagate the callers libctx down to the provider via the config load.
Note that OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, ..) is still called, but will only load the default
configuration if the OPENSSL_CONF environment variable is set.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11240)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/conf.h | 4 | ||||
-rw-r--r-- | include/openssl/crypto.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 438361e7a9..8fbb768f66 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -111,8 +111,10 @@ struct conf_st { void *meth_data; LHASH_OF(CONF_VALUE) *data; unsigned int flag_dollarid:1; + OPENSSL_CTX *libctx; }; +CONF *NCONF_new_with_libctx(OPENSSL_CTX *libctx, CONF_METHOD *meth); CONF *NCONF_new(CONF_METHOD *meth); CONF_METHOD *NCONF_default(void); DEPRECATEDIN_3_0(CONF_METHOD *NCONF_WIN32(void)) @@ -140,6 +142,8 @@ int NCONF_dump_bio(const CONF *conf, BIO *out); int CONF_modules_load(const CONF *cnf, const char *appname, unsigned long flags); +int CONF_modules_load_file_with_libctx(OPENSSL_CTX *libctx, const char *filename, + const char *appname, unsigned long flags); int CONF_modules_load_file(const char *filename, const char *appname, unsigned long flags); void CONF_modules_unload(int all); diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index a157558a51..3508144b4a 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -493,6 +493,7 @@ CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void); int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b); OPENSSL_CTX *OPENSSL_CTX_new(void); +int OPENSSL_CTX_load_config(OPENSSL_CTX *ctx, const char *config_file); void OPENSSL_CTX_free(OPENSSL_CTX *); # ifdef __cplusplus |