Skip to content

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
wolfSSL:mainfrom
JacobBarthelmeh:fenrir
Open

additional sanity checks, fix for xmemset size used, and use a local pointer for d2i_ call#226
JacobBarthelmeh wants to merge 3 commits into
wolfSSL:mainfrom
JacobBarthelmeh:fenrir

Conversation

@JacobBarthelmeh
Copy link
Copy Markdown
Contributor

Fenrir fixes

@JacobBarthelmeh JacobBarthelmeh self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 18:29
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 XMEMSET sizing 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.

Comment thread src/x509/clu_x509_sign.c Outdated
Comment thread src/x509/clu_x509_sign.c Outdated
Comment thread src/pkey/clu_pkey.c Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/x509/clu_config.c
Comment thread src/x509/clu_config.c
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #226

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/x509/clu_x509_sign.c
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;
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.

3 participants