Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Crypt-only CMake state and extended-key-usage encoding remain incorrect for supported configurations.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Adds no-heap certificate encoding support, configurable key-ID hashing, CMake crypt-only handling, and XATOI platform fallbacks.
Changes:
- Uses bounded stack buffers for certificate names and key identifiers.
- Adds SHA-3 key-ID support and dynamic SKID/AKID sizing.
- Adds CMake crypt-only plumbing, cache filtering, platform macros, and CI coverage.
| File | Description |
|---|---|
wolfssl/wolfcrypt/types.h |
Adds XATOI fallback for STRING_USER. |
wolfssl/wolfcrypt/asn.h |
Uses configured key-ID size. |
wolfssl/wolfcrypt/asn_public.h |
Selects key-ID hash and buffer sizes. |
wolfcrypt/src/asn.c |
Adds stack-based certificate encoding paths. |
wolfcrypt/test/test.c |
Tests no-heap CSR and key IDs. |
IDE/XCODE-FIPSv6/user_settings.h |
Defines XATOI. |
IDE/XCODE-FIPSv5/user_settings.h |
Defines XATOI. |
IDE/XCODE-FIPSv2/user_settings.h |
Defines XATOI. |
IDE/XCODE-FIPSv2/macOS-C++/M1/user_settings.h |
Defines XATOI. |
IDE/XCODE-FIPSv2/macOS-C++/Intel/user_settings.h |
Defines XATOI. |
IDE/WINCE/user_settings.h |
Defines XATOI. |
IDE/WICED-STUDIO/user_settings.h |
Defines XATOI. |
IDE/SimplicityStudio/user_settings.h |
Defines XATOI. |
IDE/GCC-ARM/Header/user_settings.h |
Defines XATOI. |
examples/configs/user_settings_template.h |
Documents the platform fallback. |
CMakeLists.txt |
Adds crypt-only and cache filtering logic. |
cmake/options.h.in |
Emits crypt-only macros. |
cmake/functions.cmake |
Tracks declared CMake options. |
.github/workflows/no-malloc.yml |
Expands no-heap certificate coverage. |
.github/workflows/cmake.yml |
Tests CMake option plumbing. |
.github/configs/os-check-linux.json |
Adds SHA-3 key-ID coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
dgarske
force-pushed
the
cryptonly_nomalloc
branch
from
October 1, 2026 23:58
429056b to
bd1f752
Compare
dgarske
force-pushed
the
cryptonly_nomalloc
branch
from
October 2, 2026 21:09
bd1f752 to
f8aaec2
Compare
dgarske
force-pushed
the
cryptonly_nomalloc
branch
from
October 3, 2026 00:11
f8aaec2 to
65f2058
Compare
dgarske
force-pushed
the
cryptonly_nomalloc
branch
from
October 3, 2026 01:27
65f2058 to
dc854a6
Compare
dgarske
force-pushed
the
cryptonly_nomalloc
branch
from
October 3, 2026 01:38
dc854a6 to
1e5f994
Compare
Comment on lines
+38191
to
38196
| /* CertID.hashAlgorithm names the hash the issuer hashes were made | ||
| * with (RFC 6960 4.1.1), which is per certificate in an SM build. */ | ||
| req->hashAlg = wc_HashGetOID( | ||
| wc_HashTypeConvert(HashIdAlg(cert->signatureOID))); | ||
| XMEMCPY(req->issuerHash, cert->issuerHash, KEYID_SIZE); | ||
| XMEMCPY(req->issuerKeyHash, cert->issuerKeyHash, KEYID_SIZE); |
Comment on lines
+1324
to
+1327
| #if defined(STRING_USER) && !defined(XATOI) && \ | ||
| (defined(WOLFSSL_CERT_EXT) || defined(HAVE_OCSP) || \ | ||
| defined(HAVE_CRL_IO) || defined(HAVE_HTTP_CLIENT) || \ | ||
| defined(OPENSSL_EXTRA)) |
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
Four independent CMake and wolfCrypt fixes for
WOLFSSL_NO_MALLOCbare-metal builds.Changes
options.hWOLFSSL_CRYPT_ONLYemits-DWOLFCRYPT_ONLYand-DNO_TLS, matching--enable-cryptonly, and forces the TLS-layer options off sooptions.hdescribes the library that was built.WOLF*cache variables are filtered out, and a dependency force with no matching option is reported rather than silently ignored.WOLFSSL_MCASTis now declared after the crypt-only block so that force is consumed; a crypt-only build previously keptWOLFSSL_MULTICASTandHAVE_NULL_CIPHER.wc_MakeCert(),wc_MakeCertReq_ex(),SetKeyIdFromPublicKey()and the name and extension encoders use stack arrays bounded byWC_ASN_MAX_NAME_ENTRIESandMAX_PUBLIC_KEY_SZ.WC_ASN_KEYID_HASH_TYPEandWC_ASN_KEYID_SZname the hash and its size once.KEYID_SIZE,SIGNER_DIGEST_SIZE,OCSP_DIGEST,OCSP_DIGEST_SIZEandOCSP_RESPONDER_ID_HASH_TYPEall derive from them instead of each re-deriving an answer fromNO_SHA.WC_ASN_HASH_SHA256, whereKEYID_SIZEfollowed the option butSIGNER_DIGEST_SIZEstayed at the SHA-1 size, soCalcHashId()wrote past the hash buffers inFindRevokedSerial()andGetCAByAKID(). An OCSPCertIDnow also carries the OID of the hash that produced the issuer hashes it contains.CalcHashId_ex()dispatches on the algorithm the caller names, keeping the SHA-3 state on the stack so the no-allocator path is preserved.XATOIunderSTRING_USERand in the platform templatesTesting
make checkon a default build and on--enable-all;wolfcrypt_test()across the cryptonly SHA3, SHA3-384, no-heap certificate, C89 and--disable-inlineconfigurations.sha3-keyid-ocsp-crlandsha3-384-keyidentries compile the OCSP and Signer hash selectors in SHA3-only builds, which a cryptonly entry does not reach, and cover the key identifier larger than the 32-byte floor.options.hmacros compared against the equivalent./configurebuild.