Make wolfCOSE build and CI ISO C99 conformant#37
Open
aidangarske wants to merge 1 commit into
Open
Conversation
11b7557 to
5e1afd9
Compare
Switch the Makefile and every CI workflow from -std=c11 to -std=c99 and add a c99-check gate (-pedantic-errors -Werror over all sources on gcc and clang, default and WOLFCOSE_FLOAT feature sets) plus a C99 Compliance workflow, so the C99 claim is enforced rather than asserted. Two issues the C99 switch surfaced, fixed here: - Define HAVE_ANONYMOUS_INLINE_AGGREGATES=1 on every wolfCOSE compile. -std=c99 otherwise disables it (wolfSSL gates it on __STDC_VERSION__ >= 201101L), which shrinks WC_RNG. wolfSSL itself builds with the compiler default (gnu11) where the macro is on, so against a dilithium-enabled wolfSSL its WC_RNG is 8 bytes larger than wolfCOSE -std=c99 expects; wolfSSL writes past wolfCOSE's stack WC_RNG and corrupts the RNG, breaking every COSE ECDSA verify. EdDSA (deterministic) and AES-GCM/HMAC, which draw no nonce, were unaffected. Stable wolfSSL is identical under c99/c11, so only master failed. - Key the master wolfSSL cache on its commit SHA. The workflows cached master under a static key and only rebuilt on a miss, freezing one master snapshot indefinitely. Pinned -stable caches keep their immutable keys. Also fix a uint64_t/size_t mismatch in tests/test_cose.c exposed by the gate: wc_CBOR_DecodeArrayStart takes size_t*, and the same variable doubled as a uint64_t CBOR tag; split into a size_t count and a uint64_t tag.
8c5cbe9 to
f8aca7a
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #37
Scan targets checked: wolfcose-bugs, wolfcose-src
No new issues found in the changed files. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description