From 38cfb11d47a6f8c1cbfcdb69f7e10f928521d250 Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 22 Sep 2019 10:39:17 +1000 Subject: [PATCH] Make the "engine" parameter to some provider algorithms (KDF/PRF) hidden. This parameter will disappear once engines are wrapped by a provider so it shouldn't ever be visible to the public. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9971) --- include/openssl/core_names.h | 3 --- providers/common/provider_util.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h index ad4cf50bb5..e395ed3b7b 100644 --- a/include/openssl/core_names.h +++ b/include/openssl/core_names.h @@ -48,7 +48,6 @@ extern "C" { #define OSSL_ALG_PARAM_DIGEST "digest" /* utf8_string */ #define OSSL_ALG_PARAM_CIPHER "cipher" /* utf8_string */ #define OSSL_ALG_PARAM_MAC "mac" /* utf8_string */ -#define OSSL_ALG_PARAM_ENGINE "engine" /* utf8_string */ #define OSSL_ALG_PARAM_PROPERTIES "properties"/* utf8_string */ /* cipher parameters */ @@ -94,7 +93,6 @@ extern "C" { */ #define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER /* utf8 string */ #define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST /* utf8 string */ -#define OSSL_MAC_PARAM_ENGINE OSSL_ALG_PARAM_ENGINE /* utf8 string */ #define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES /* utf8 string */ #define OSSL_MAC_PARAM_SIZE "size" /* size_t */ @@ -112,7 +110,6 @@ extern "C" { #define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST /* utf8 string */ #define OSSL_KDF_PARAM_MAC OSSL_ALG_PARAM_MAC /* utf8 string */ #define OSSL_KDF_PARAM_MAC_SIZE "maclen" /* size_t */ -#define OSSL_KDF_PARAM_ENGINE OSSL_ALG_PARAM_ENGINE /* utf8 string */ #define OSSL_KDF_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES /* utf8 string */ #define OSSL_KDF_PARAM_ITER "iter" /* unsigned int */ #define OSSL_KDF_PARAM_MODE "mode" /* utf8 string or int */ diff --git a/providers/common/provider_util.c b/providers/common/provider_util.c index 796d00d376..8384cdc2a0 100644 --- a/providers/common/provider_util.c +++ b/providers/common/provider_util.c @@ -46,7 +46,7 @@ static int load_common(const OSSL_PARAM params[], const char **propquery, /* TODO legacy stuff, to be removed */ /* Inside the FIPS module, we don't support legacy ciphers */ #if !defined(FIPS_MODE) && !defined(OPENSSL_NO_ENGINE) - p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE); + p = OSSL_PARAM_locate_const(params, "engine"); if (p != NULL) { if (p->data_type != OSSL_PARAM_UTF8_STRING) return 0; @@ -221,10 +221,10 @@ int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx, (char *)properties, 0); #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE) - if ((p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE)) != NULL) { + if ((p = OSSL_PARAM_locate_const(params, "engine")) != NULL) { if (p->data_type != OSSL_PARAM_UTF8_STRING) return 0; - *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ENGINE, + *mp++ = OSSL_PARAM_construct_utf8_string("engine", p->data, p->data_size); } #endif -- 2.34.1