diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-08-19 09:18:33 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2019-08-19 09:18:33 +1000 |
commit | 25e601445ae244ed623b2f5d6b28788488d87663 (patch) | |
tree | fe5c8cc5d0d9e828de208626a316e922dec258ff /crypto/provider_core.c | |
parent | 5e0d9c861bc44070c61b9b109884dc8aa5e2e8d1 (diff) | |
download | openssl-new-25e601445ae244ed623b2f5d6b28788488d87663.tar.gz |
Add fips provider code for handling self test data
More PR's related to self test will be derived from this PR.
Note: the code removed in core_get_params() was causing a freeze since the
fips module was being loaded from a config file, which then called core_get_params()
which then tried to init the config fle again...
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9596)
Diffstat (limited to 'crypto/provider_core.c')
-rw-r--r-- | crypto/provider_core.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 6abada3c4b..541a1e169b 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -9,6 +9,7 @@ #include <openssl/core.h> #include <openssl/core_numbers.h> +#include <openssl/core_names.h> #include <openssl/params.h> #include <openssl/opensslv.h> #include "internal/cryptlib_int.h" @@ -751,7 +752,7 @@ const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov, * never knows. */ static const OSSL_PARAM param_types[] = { - OSSL_PARAM_DEFN("openssl-verstion", OSSL_PARAM_UTF8_PTR, NULL, 0), + OSSL_PARAM_DEFN("openssl-version", OSSL_PARAM_UTF8_PTR, NULL, 0), OSSL_PARAM_DEFN("provider-name", OSSL_PARAM_UTF8_PTR, NULL, 0), OSSL_PARAM_END }; @@ -781,16 +782,16 @@ static int core_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]) int i; OSSL_PARAM *p; -#ifndef FIPS_MODE - /* Load config before we attempt to read any provider parameters */ - OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); -#endif - if ((p = OSSL_PARAM_locate(params, "openssl-version")) != NULL) OSSL_PARAM_set_utf8_ptr(p, OPENSSL_VERSION_STR); if ((p = OSSL_PARAM_locate(params, "provider-name")) != NULL) OSSL_PARAM_set_utf8_ptr(p, prov->name); +#ifndef FIPS_MODE + if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_MODULE_FILENAME)) != NULL) + OSSL_PARAM_set_utf8_ptr(p, ossl_provider_module_path(prov)); +#endif + if (prov->parameters == NULL) return 1; @@ -800,7 +801,6 @@ static int core_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]) if ((p = OSSL_PARAM_locate(params, pair->name)) != NULL) OSSL_PARAM_set_utf8_ptr(p, pair->value); } - return 1; } @@ -868,6 +868,10 @@ static const OSSL_DISPATCH core_dispatch_[] = { { OSSL_FUNC_CORE_NEW_ERROR, (void (*)(void))core_new_error }, { OSSL_FUNC_CORE_SET_ERROR_DEBUG, (void (*)(void))core_set_error_debug }, { OSSL_FUNC_CORE_VSET_ERROR, (void (*)(void))core_vset_error }, + { OSSL_FUNC_BIO_NEW_FILE, (void (*)(void))BIO_new_file }, + { OSSL_FUNC_BIO_NEW_MEMBUF, (void (*)(void))BIO_new_mem_buf }, + { OSSL_FUNC_BIO_READ, (void (*)(void))BIO_read }, + { OSSL_FUNC_BIO_FREE, (void (*)(void))BIO_free }, #endif { OSSL_FUNC_CRYPTO_MALLOC, (void (*)(void))CRYPTO_malloc }, |