* outside; this file e_os.h is not part of the exported interface.
*/
-/* ossl_static_assert_type_eq: gcc-only variable type static assertion */
-# if defined(__GNUC__) && !defined(__clang__)
-# define ossl_static_assert_type_eq(type, x) \
- _Static_assert((__builtin_types_compatible_p(type, __typeof__(x))), \
- #x " type check failed, expected: " #type)
-# else
-# define ossl_static_assert_type_eq(type, x)
-# endif
-
# if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
# define NO_CHMOD
# define NO_SYSLOG
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,
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",
/*
* 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",