additional sanity checks, fix for xmemset size used, and use a local pointer for d2i_ call#226
Open
JacobBarthelmeh wants to merge 3 commits into
Open
additional sanity checks, fix for xmemset size used, and use a local pointer for d2i_ call#226JacobBarthelmeh wants to merge 3 commits into
JacobBarthelmeh wants to merge 3 commits into
Conversation
…pointer for d2i_ call
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens several wolfCLU subcommands by adding sanity checks around input parsing and fixing a couple of buffer-handling and decoding pitfalls (notably around X.509 subject parsing, alt-name RID parsing, algorithm/filename bounds checks, XMSS parameter buffer clearing, and DER decode pointer usage).
Changes:
- Tighten parsing/validation for X.509 subject handling and uniqueness checks, and add memory cleanup for parsed names.
- Add bounds/range checks when parsing dotted RID alt-names and when copying user-provided strings into fixed-size buffers.
- Fix incorrect
XMEMSETsizing for XMSS parameter buffers and adjust DER decode usage to use a local pointer.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/x509/clu_x509_sign.c | Strengthens subject token parsing and unique-subject-name checking; adds additional NULL handling and frees parsed names. |
| src/x509/clu_config.c | Adds bounds/range validation when parsing dotted RID values for subjectAltName. |
| src/tools/clu_funcs.c | Adds algorithm-name length validation and uses bounded XSTRLCPY. |
| src/pkey/clu_pkey.c | Uses a local pointer for DER decode calls to avoid mutating the original buffer pointer. |
| src/genkey/clu_genkey_setup.c | Adds -out filename length checks and fixes XMEMSET size arguments for XMSS parameter buffers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #226
Scan targets checked: wolfclu-bugs, wolfclu-src
No new issues found in the changed files. ✅
Comment on lines
652
to
656
| else { | ||
| XMEMCPY(subj, subject, subjSz); | ||
| token = XSTRTOK(subj, "/", &slash); | ||
| while (token != NULL) { | ||
| while (token != NULL && ret == WOLFCLU_SUCCESS) { | ||
| saveptr = NULL; |
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.
Fenrir fixes