wolfssl: Avoid conflict with RNG when built without EdDSA or FIPS enabled

There are definitions of RNG in <wolfssl/wolfcrypt/settings.h> and
<wolfssl/wolfcrypt/random.h> that play havoc with the literal RNG being
used in the expansions of PLUGIN_*(RNG, ...) when ##-concatenated to
build the enum value FEATURE_RNG.

The #undef in wolfssl_cmmon.h only had an effect if wolfSSL was built
with EdDSA or FIPS enabled, otherwise, the headers that define RNG were
not pulled in before it.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville 2024-03-27 17:41:18 -06:00 committed by Tobias Brunner
parent 1b19053919
commit e5bc3a50f6
2 changed files with 2 additions and 3 deletions

View File

@ -80,7 +80,4 @@ typedef union {
#undef PARSE_ERROR
/* Eliminate macro conflicts */
#undef RNG
#endif /* WOLFSSL_PLUGIN_COMMON_H_ */

View File

@ -47,6 +47,8 @@
#include <wolfssl/ssl.h>
#undef RNG
#ifndef FIPS_MODE
#define FIPS_MODE 0
#endif