Skip to content

PKCS7 additional sanity checks - #12086

Open
JacobBarthelmeh wants to merge 2 commits into
wolfSSL:masterfrom
JacobBarthelmeh:pkcs7
Open

JacobBarthelmeh wants to merge 2 commits into
wolfSSL:masterfrom
JacobBarthelmeh:pkcs7

Conversation

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

F-12379 and F-16275

@JacobBarthelmeh JacobBarthelmeh self-assigned this Nov 10, 2026
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the PKCS#7 input-validation changes and regression coverage.

No open issues 🎉

What changed in this PR

Tightens wolfCrypt’s PKCS#7 input validation and adds regression coverage for malformed signed and enveloped data.

Changes:

  • Returns ASN_PARSE_E when the initial SignedData sequence cannot be parsed.
  • Rejects empty KTRI encrypted keys before allocation and decryption.
  • Adds tests for malformed inputs and repeated verification failures.
File Description
wolfcrypt/​src/​pkcs7.c Adds explicit parse errors for invalid SignedData sequences and empty encrypted keys.
tests/​api/​test_pkcs7.h Declares and registers the two new regression tests.
tests/​api/​test_pkcs7.c Tests malformed KTRI input and rejection of non-sequence SignedData input.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

gcc-arm-cortex-m4-pkcs7

  • FLASH: .text +64 B (+0.0%, 223,188 B / 262,144 B, total: 85% used)

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +20 B, text +10,016 B (+3.6%, 292,508 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

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.

2 participants