From: Pauli Date: Wed, 12 Jan 2022 01:28:29 +0000 (+1100) Subject: Avoid using a macro expansion in a macro when statically initialising X-Git-Tag: openssl-3.2.0-alpha1~3086 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c5d1451292566e546d5dd01c7f19950fa34391d;p=thirdparty%2Fopenssl.git Avoid using a macro expansion in a macro when statically initialising Circumvents a problem with ancient PA-RISC compilers on HP/UX. Fixes #17477 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17478) --- diff --git a/providers/fips/self_test_data.inc b/providers/fips/self_test_data.inc index dd39ab5252a..f2c1af04b63 100644 --- a/providers/fips/self_test_data.inc +++ b/providers/fips/self_test_data.inc @@ -18,7 +18,7 @@ { name, OSSL_PARAM_OCTET_STRING, ITM(data) } #define ST_KAT_PARAM_UTF8STRING(name, data) \ { name, OSSL_PARAM_UTF8_STRING, ITM_STR(data) } -#define ST_KAT_PARAM_UTF8CHAR(name, data) \ +#define ST_KAT_PARAM_UTF8CHAR(name, data) \ { name, OSSL_PARAM_UTF8_STRING, ITM(data) } #define ST_KAT_PARAM_INT(name, i) \ { name, OSSL_PARAM_INTEGER, ITM(i) } @@ -1291,9 +1291,15 @@ static const ST_KAT_PARAM rsa_priv_key[] = { ST_KAT_PARAM_END() }; +/*- + * Using OSSL_PKEY_RSA_PAD_MODE_NONE directly in the expansion of the + * ST_KAT_PARAM_UTF8STRING macro below causes a failure on ancient + * HP/UX PA-RISC compilers. + */ +static const char pad_mode_none[] = OSSL_PKEY_RSA_PAD_MODE_NONE; + static const ST_KAT_PARAM rsa_enc_params[] = { - ST_KAT_PARAM_UTF8STRING(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, - OSSL_PKEY_RSA_PAD_MODE_NONE), + ST_KAT_PARAM_UTF8STRING(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, pad_mode_none), ST_KAT_PARAM_END() };