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 /crypto/context.c | |
parent | 0f2deef59d13e852a4bde0e853e9b49bab51a108 (diff) | |
download | openssl-22e27978b29b2cdc1db79659ed653d6cf31834ab.tar.gz |
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 'crypto/context.c')
-rw-r--r-- | crypto/context.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/context.c b/crypto/context.c index 02fecf9f35..dcf960bfa7 100644 --- a/crypto/context.c +++ b/crypto/context.c @@ -8,6 +8,7 @@ */ #include "crypto/cryptlib.h" +#include <openssl/conf.h> #include "internal/thread_once.h" #include "internal/property.h" @@ -145,6 +146,13 @@ OPENSSL_CTX *OPENSSL_CTX_new(void) return ctx; } +#ifndef FIPS_MODE +int OPENSSL_CTX_load_config(OPENSSL_CTX *ctx, const char *config_file) +{ + return CONF_modules_load_file_with_libctx(ctx, config_file, NULL, 0) > 0; +} +#endif + void OPENSSL_CTX_free(OPENSSL_CTX *ctx) { if (ctx != NULL) |