summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-05-25 14:48:41 -0400
committerPauli <pauli@openssl.org>2021-06-02 12:40:02 +1000
commit6b750b89ee9ad3952b1b25e47b848abc8b60e7dd (patch)
tree15c5f382192521533d08ea291a6cab7855ad376f /crypto
parentff234c6804571b70bc02ff44df1f42c4a3fe5cf1 (diff)
Add NCONF_get0_libctx()
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15466)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/conf/conf_api.c5
-rw-r--r--crypto/evp/evp_cnf.c6
-rw-r--r--crypto/provider_conf.c3
-rw-r--r--crypto/rand/rand_lib.c2
4 files changed, 12 insertions, 4 deletions
diff --git a/crypto/conf/conf_api.c b/crypto/conf/conf_api.c
index e4e305c714..2d72a6ab32 100644
--- a/crypto/conf/conf_api.c
+++ b/crypto/conf/conf_api.c
@@ -20,6 +20,11 @@
static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);
+OSSL_LIB_CTX *NCONF_get0_libctx(CONF *conf)
+{
+ return conf->libctx;
+}
+
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
{
CONF_VALUE vv;
diff --git a/crypto/evp/evp_cnf.c b/crypto/evp/evp_cnf.c
index c13652ca0f..415712dffa 100644
--- a/crypto/evp/evp_cnf.c
+++ b/crypto/evp/evp_cnf.c
@@ -46,12 +46,14 @@ static int alg_module_init(CONF_IMODULE *md, const CONF *cnf)
* fips_mode is deprecated and should not be used in new
* configurations.
*/
- if (!EVP_default_properties_enable_fips(cnf->libctx, m > 0)) {
+ if (!EVP_default_properties_enable_fips(NCONF_get0_libctx((CONF *)cnf),
+ m > 0)) {
ERR_raise(ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE);
return 0;
}
} else if (strcmp(oval->name, "default_properties") == 0) {
- if (!evp_set_default_properties_int(cnf->libctx, oval->value, 0, 0)) {
+ if (!evp_set_default_properties_int(NCONF_get0_libctx((CONF *)cnf),
+ oval->value, 0, 0)) {
ERR_raise(ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE);
return 0;
}
diff --git a/crypto/provider_conf.c b/crypto/provider_conf.c
index 5725ef3c63..977d469808 100644
--- a/crypto/provider_conf.c
+++ b/crypto/provider_conf.c
@@ -199,7 +199,8 @@ static int provider_conf_init(CONF_IMODULE *md, const CONF *cnf)
for (i = 0; i < sk_CONF_VALUE_num(elist); i++) {
cval = sk_CONF_VALUE_value(elist, i);
- if (!provider_conf_load(cnf->libctx, cval->name, cval->value, cnf))
+ if (!provider_conf_load(NCONF_get0_libctx((CONF *)cnf),
+ cval->name, cval->value, cnf))
return 0;
}
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index a7a8c70523..a3305b76b4 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -746,7 +746,7 @@ static int random_conf_init(CONF_IMODULE *md, const CONF *cnf)
{
STACK_OF(CONF_VALUE) *elist;
CONF_VALUE *cval;
- RAND_GLOBAL *dgbl = rand_get_global(cnf->libctx);
+ RAND_GLOBAL *dgbl = rand_get_global(NCONF_get0_libctx((CONF *)cnf));
int i, r = 1;
OSSL_TRACE1(CONF, "Loading random module: section %s\n",