summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-07-31 17:29:21 +0100
committerMatt Caswell <matt@openssl.org>2020-08-17 11:27:51 +0100
commite6c54619d151eeec32055bbd713cda11a9182246 (patch)
tree7d1e275da8ee5d4ecbe66ae3c5593573b48dc1f2 /crypto/property
parentebe3f24b3d53e503bd37a2a08a8b1f896014c30d (diff)
Load the default config file before working with default properties
A config file can change the global default properties. Therefore we must ensure that the config file is loaded before reading or amending them. Fixes #12565 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12567)
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/property/property.c b/crypto/property/property.c
index cb82f8956b..608a909d49 100644
--- a/crypto/property/property.c
+++ b/crypto/property/property.c
@@ -96,8 +96,13 @@ static const OPENSSL_CTX_METHOD ossl_ctx_global_properties_method = {
ossl_ctx_global_properties_free,
};
-OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OPENSSL_CTX *libctx)
+OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OPENSSL_CTX *libctx,
+ int loadconfig)
{
+#ifndef FIPS_MODULE
+ if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
+ return NULL;
+#endif
return openssl_ctx_get_data(libctx, OPENSSL_CTX_GLOBAL_PROPERTIES,
&ossl_ctx_global_properties_method);
}
@@ -352,7 +357,7 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid,
if (prop_query != NULL)
p2 = pq = ossl_parse_query(store->ctx, prop_query);
- plp = ossl_ctx_global_properties(store->ctx);
+ plp = ossl_ctx_global_properties(store->ctx, 1);
if (plp != NULL && *plp != NULL) {
if (pq == NULL) {
pq = *plp;