Skip to content

Null key aes - #11811

Open
night1rider wants to merge 3 commits into
wolfSSL:masterfrom
night1rider:NULL-Key-AES
Open

night1rider wants to merge 3 commits into
wolfSSL:masterfrom
night1rider:NULL-Key-AES

Conversation

@night1rider

@night1rider night1rider commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Lets a NULL AES key reach the SetKey crypto callback, so a device that holds the key itself can take it.
Software still returns BAD_FUNC_ARG for a NULL key, but only after the callback says CRYPTOCB_UNAVAILABLE (generic C, ARM32 asm, PPC asm).
Ports with no SetKey callback (STM32, LTC, ESP32, MMCAU, AF_ALG) now reject a NULL key up front.
The AES_SETKEY callback path still rejects a NULL key; this PR leaves it as is.
Test: ./configure --enable-aesctr --enable-aesccm --enable-cryptocb --enable-cryptocbutils=setkey,free CPPFLAGS=-DWOLF_CRYPTO_CB_FIND && make && ./tests/unit.test --api --group aes
The ARM32 and PPC64 versions run in CI as armhf-armasm-setkey, armhf-armasm-aes-setkey and ppc64le-asm-aes.

@night1rider night1rider self-assigned this Oct 19, 2026
Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:42

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #11811

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/ci-deps/packages-ubuntu-22.04-minimal.txt, .github/configs/multi-arch.json, .github/configs/os-check-linux.json, .github/configs/os-check-macos.json, .github/workflows/multi-arch.yml, doc/dox_comments/header_files/aes.h, tests/api/test_aes.h
Coverage: 4 of 6 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_aes.c, wolfssl/wolfcrypt/cryptocb.h

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

stm32-sim-stm32h753

  • FLASH: .text +64 B (+0.0%, 209,644 B / 2,097,152 B, total: 10% used)

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +108 B, text +13,496 B (+4.8%, 296,076 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.

Covers a NULL key reaching the SetKey callback on each AES path.
Do the same in the ARM32 and PPC asm wc_AesSetKey.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #11811

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/ci-deps/packages-ubuntu-22.04-minimal.txt, .github/configs/multi-arch.json, .github/configs/os-check-linux.json, .github/configs/os-check-macos.json, .github/workflows/multi-arch.yml, doc/dox_comments/header_files/aes.h, tests/api/test_aes.h
Coverage: 5 of 5 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Max

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