diff options
author | Pauli <pauli@openssl.org> | 2022-01-12 12:28:29 +1100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-01-13 20:09:40 +1100 |
commit | 9c5d1451292566e546d5dd01c7f19950fa34391d (patch) | |
tree | 0c38814b3c4d6fa042d468c419d2b2eb6d9cf399 | |
parent | 64a644530e023d3064db9027b0977d33b1d2ad9a (diff) |
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 <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17478)
-rw-r--r-- | providers/fips/self_test_data.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/providers/fips/self_test_data.inc b/providers/fips/self_test_data.inc index dd39ab5252..f2c1af04b6 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() }; |