Skip to content

Conversation

@douzzer
Copy link
Contributor

@douzzer douzzer commented Oct 21, 2025

wolfssl/wolfcrypt/types.h:

  • fix WC_MIN_SINT_OF().
  • add outer cast back to target type in WC_MAX_UINT_OF() and WC_MAX_SINT_OF().
  • rename WC_SAFE_SUM_*_NO_WUR() to WC_SAFE_SUM_*_CLIP().
  • remove clipping assignments from failure paths in WC_WUR_INT() variants.
  • add WC_SAFE_SUB_UNSIGNED_CLIP(), WC_SAFE_SUB_UNSIGNED(), WC_SAFE_SUB_SIGNED_CLIP(), and WC_SAFE_SUB_SIGNED().
  • add Coverity-specific annotations in WC_SAFE_*() to suppress false-positive overflow warnings.

wolfcrypt/test/test.c:

  • implement macro_test().
  • fix stray uint32_t's in crypto_ecc_verify() and crypto_ecc_sign() arg lists.

wolfssl/wolfcrypt/ext_xmss.h: fix stray uint32_t.

tested with

wolfssl-multi-test.sh ...
clang-tidy-all-sp-all
check-source-text
defaults-cryptonly-c99-Wconversion-m32-build
quantum-safe-wolfssl-all-gcc-latest-m32
allcryptonly-gcc-c89
all-c89-cppcheck
defaults-cryptonly-c89-Wconversion-build
defaults-cryptonly-c89-Wconversion-m32-build

* fix WC_MIN_SINT_OF().
* add outer cast back to target type in WC_MAX_UINT_OF() and WC_MAX_SINT_OF().
* rename WC_SAFE_SUM_*_NO_WUR to WC_SAFE_SUM_*_CLIP().
* remove clipping assignments from failure paths in WC_WUR_INT() variants.
* add WC_SAFE_SUB_UNSIGNED_CLIP(), WC_SAFE_SUB_UNSIGNED(), WC_SAFE_SUB_SIGNED_CLIP(), and WC_SAFE_SUB_SIGNED().
* add Coverity-specific annotations in WC_SAFE_*() to suppress false-positive overflow warnings.

wolfcrypt/test/test.c:
* implement macro_test().
* fix stray uint32_t's in crypto_ecc_verify() and crypto_ecc_sign() arg lists.

wolfssl/wolfcrypt/ext_xmss.h: fix stray uint32_t.
@douzzer douzzer force-pushed the 20251020-coverity-WC_SAFE_foo branch from e1bb492 to 279238c Compare October 21, 2025 04:27
…ialized local variable" in GrowOutputBuffer().
Copy link
Contributor

@philljj philljj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a macro sanity test for math was long due!

@dgarske dgarske assigned douzzer and unassigned philljj Oct 21, 2025
@dgarske dgarske merged commit 9c3a0e3 into wolfSSL:master Oct 21, 2025
347 of 349 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants