diff options
author | Matt Caswell <matt@openssl.org> | 2020-07-31 18:29:21 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-08-17 12:27:51 +0200 |
commit | e6c54619d151eeec32055bbd713cda11a9182246 (patch) | |
tree | 7d1e275da8ee5d4ecbe66ae3c5593573b48dc1f2 /crypto/property | |
parent | provider: disable fall-backs if OSSL_PROVIDER_load() fails. (diff) | |
download | openssl-e6c54619d151eeec32055bbd713cda11a9182246.tar.xz openssl-e6c54619d151eeec32055bbd713cda11a9182246.zip |
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.c | 9 |
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; |