From: Pauli Date: Sat, 7 Sep 2019 00:48:07 +0000 (+1000) Subject: Use common define for properties, engine, cipher and digest params X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb74317b4f525feca9129944f82e74e23b2e381f;p=openssl Use common define for properties, engine, cipher and digest params Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9770) --- diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h index 1d8857295c..b78a0978fd 100644 --- a/include/openssl/core_names.h +++ b/include/openssl/core_names.h @@ -40,6 +40,16 @@ extern "C" { */ #define OSSL_PROV_PARAM_MODULE_FILENAME "module-filename" +/* + * Algorithm parameters + * If "engine" or "properties" are specified, they should always be paired + * with the algorithm type. + */ +#define OSSL_ALG_PARAM_DIGEST "digest" /* utf8_string */ +#define OSSL_ALG_PARAM_CIPHER "cipher" /* utf8_string */ +#define OSSL_ALG_PARAM_ENGINE "engine" /* utf8_string */ +#define OSSL_ALG_PARAM_PROPERTIES "properties"/* utf8_string */ + /* cipher parameters */ #define OSSL_CIPHER_PARAM_PADDING "padding" /* uint */ #define OSSL_CIPHER_PARAM_MODE "mode" /* uint */ @@ -80,10 +90,10 @@ extern "C" { * If "engine" or "properties" are specified, they should always be paired * with "cipher" or "digest". */ -#define OSSL_MAC_PARAM_CIPHER "cipher" /* utf8 string */ -#define OSSL_MAC_PARAM_DIGEST "digest" /* utf8 string */ -#define OSSL_MAC_PARAM_ENGINE "engine" /* utf8 string */ -#define OSSL_MAC_PARAM_PROPERTIES "properties" /* utf8 string */ +#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 */ /* Known MAC names (not a complete list) */ @@ -97,10 +107,11 @@ extern "C" { #define OSSL_KDF_PARAM_KEY "key" /* octet string */ #define OSSL_KDF_PARAM_SALT "salt" /* octet string */ #define OSSL_KDF_PARAM_PASSWORD "pass" /* octet string */ -#define OSSL_KDF_PARAM_DIGEST "digest" /* utf8 string */ +#define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST /* utf8 string */ #define OSSL_KDF_PARAM_MAC "mac" /* utf8 string */ #define OSSL_KDF_PARAM_MAC_SIZE "maclen" /* size_t */ -#define OSSL_KDF_PARAM_PROPERTIES "properties" /* utf8 string */ +#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 */ #define OSSL_KDF_PARAM_PKCS5 "pkcs5" /* int */