diff options
author | Matt Caswell <matt@openssl.org> | 2023-09-13 10:31:46 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-09-15 09:20:05 +1000 |
commit | fc785a554cc37dfa94710b28ced45b03006f0300 (patch) | |
tree | cfe2ab6acb42113b754686c606dbc28c42a215d7 /providers | |
parent | 46b43c9f98771139735656e541c8f4c8018c2667 (diff) |
Remove use of _Static_assert
We had some use of the C11 _Static_assert feature which can cause some
problems on some platforms. Everywhere we were using it, it is not really
required so remove it.
Fixes #22017
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22091)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/kdfs/argon2.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/providers/implementations/kdfs/argon2.c b/providers/implementations/kdfs/argon2.c index 323b0f3ab6..d93381c410 100644 --- a/providers/implementations/kdfs/argon2.c +++ b/providers/implementations/kdfs/argon2.c @@ -1185,8 +1185,7 @@ static int kdf_argon2_ctx_set_lanes(KDF_ARGON2 *ctx, uint32_t lanes) static int kdf_argon2_ctx_set_t_cost(KDF_ARGON2 *ctx, uint32_t t_cost) { - /* ARGON2_MAX_MEMORY == max m_cost value, skip check, enforce type */ - ossl_static_assert_type_eq(uint32_t, t_cost); + /* ARGON2_MAX_MEMORY == max m_cost value, so skip check */ if (t_cost < ARGON2_MIN_TIME) { ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT, @@ -1200,8 +1199,7 @@ static int kdf_argon2_ctx_set_t_cost(KDF_ARGON2 *ctx, uint32_t t_cost) static int kdf_argon2_ctx_set_m_cost(KDF_ARGON2 *ctx, uint32_t m_cost) { - /* ARGON2_MAX_MEMORY == max m_cost value, skip check, enforce type */ - ossl_static_assert_type_eq(uint32_t, m_cost); + /* ARGON2_MAX_MEMORY == max m_cost value, so skip check */ if (m_cost < ARGON2_MIN_MEMORY) { ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_MEMORY_SIZE, "min: %u", @@ -1218,11 +1216,8 @@ static int kdf_argon2_ctx_set_out_length(KDF_ARGON2 *ctx, uint32_t outlen) /* * ARGON2_MAX_OUT_LENGTH == max outlen value, so upper bounds checks * are always satisfied; to suppress compiler if statement tautology - * warnings, these checks are skipped; however, to ensure that these - * limits are met and implementation conforming to Argon2 RFC, we need - * to fix the type + * warnings, these checks are skipped. */ - ossl_static_assert_type_eq(uint32_t, outlen); if (outlen < ARGON2_MIN_OUT_LENGTH) { ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH, "min: %u", |