diff options
author | Pauli <pauli@openssl.org> | 2022-01-12 12:28:29 +1100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-01-13 20:11:10 +1100 |
commit | cca25d5eb83b56ae27d81bd72bebf69c2f393e43 (patch) | |
tree | 7449b587826823f91e657643c6cc26f1a55337f1 | |
parent | f7e71772becc0dba8a0cae9766b78ea42819b849 (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)
(cherry picked from commit 9c5d1451292566e546d5dd01c7f19950fa34391d)
-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() }; |