-
Notifications
You must be signed in to change notification settings - Fork 866
Add support for no malloc with wc_CheckCertSigPubKey
#8725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
retest this please |
Retest this please |
wc_CheckCertSigPubKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customer is happy with this work, but is small typo in asn.c:18418.
9616df7
to
a1f4717
Compare
…on-blocking. Refactor DSA ASN.1 decode in ConfirmSignature. Cleanup indent in types.h. Move `struct CertSignCtx` to types.h. Move `WC_ENABLE_ASYM_KEY_IMPORT` and `WC_ENABLE_ASYM_KEY_EXPORT` to settings.h.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the WOLFSSL_NO_MALLOC configuration in the certificate signature checking code and refactors the DSA ASN.1 decoding logic. It also cleans up indentation, reformats macros in types.h, reorganizes memory allocation wrappers across multiple files, and moves the CertSignCtx struct from asn.h to types.h.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
wolfssl/wolfcrypt/types.h | Reformatted error messages and macro definitions for better multi-line readability. |
wolfssl/wolfcrypt/settings.h | Added conditional definitions for WC_ENABLE_ASYM_KEY_EXPORT and WC_ENABLE_ASYM_KEY_IMPORT. |
wolfssl/wolfcrypt/asn_public.h | Removed duplicate definitions for asymmetrical key export/import macros. |
wolfssl/wolfcrypt/asn.h | Added WOLFSSL_NO_MALLOC guards around allocation/free calls and removed CertSignCtx definitions. |
wolfcrypt/test/test.c | Suppressed an unused variable warning via an explicit (void) cast. |
wolfcrypt/src/sha256.c | Adjusted conditional compilation directives to account for WOLFSSL_NO_MALLOC. |
wolfcrypt/src/hash.c | Updated allocation conditional logic similarly to ensure proper memory management. |
wolfcrypt/src/asn.c | Wrapped memory allocation and free calls with WOLFSSL_NO_MALLOC checks and refactored DSA decode. |
Comments suppressed due to low confidence (2)
wolfcrypt/src/asn.c:17921
- The allocation calls in ConfirmSignature are repeatedly wrapped with #ifndef WOLFSSL_NO_MALLOC. Consider defining a helper macro or inline function to reduce duplication and improve clarity.
sigCtx->digest = (byte*)XMALLOC(WC_MAX_DIGEST_SIZE, sigCtx->heap, DYNAMIC_TYPE_DIGEST);
wolfcrypt/src/asn.c:17507
- There are multiple conditional wrappers around memory free calls (and corresponding allocations) due to WOLFSSL_NO_MALLOC. A brief inline comment explaining the rationale for these wrappers would improve future maintainability.
XFREE(sigCtx->sigCpy, sigCtx->heap, DYNAMIC_TYPE_SIGNATURE);
Description
WOLFSSL_NO_MALLOC
inwc_CheckCertSigPubKey
. Fixes ZD 19593struct CertSignCtx
to types.h.WC_ENABLE_ASYM_KEY_IMPORT
andWC_ENABLE_ASYM_KEY_EXPORT
to settings.h.Testing
Checklist