Skip to content

Reject aes-gcm/ccm encryption and decryption when no iv/nonce has been set #442

Open
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:aes-ccm-gcm-iv-fixes
Open

Reject aes-gcm/ccm encryption and decryption when no iv/nonce has been set #442
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:aes-ccm-gcm-iv-fixes

Conversation

@gasbytes

@gasbytes gasbytes commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reject aes-gcm/ccm encryption and decryption when no iv/nonce has been set, and add regression tests covering key-only operations (single-shot, streaming, final-without-update for GCM and single-shot for CCM).

Copilot AI 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.

Pull request overview

This PR tightens AEAD safety in the wolfProvider AES-GCM and AES-CCM implementations by rejecting encryption/decryption attempts when the caller has not supplied an IV/nonce, and adds regression tests for “key-only” operation patterns.

Changes:

  • Add IV/nonce presence checks for AES-GCM single-shot and streaming paths.
  • Add nonce presence checks for AES-CCM encryption initialization.
  • Register and implement new unit tests to ensure key-only encrypt flows are rejected (single-shot and streaming).

Reviewed changes

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

File Description
src/wp_aes_aead.c Adds/adjusts IV/nonce validation checks in AES-GCM and AES-CCM AEAD code paths.
test/test_aestag.c Adds new regression tests for AES-GCM/AES-CCM “key but no IV/nonce” encryption (single-shot + streaming for GCM).
test/unit.h Declares the new test entry points.
test/unit.c Registers the new tests in the unit test list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wp_aes_aead.c
Comment thread src/wp_aes_aead.c Outdated
Comment thread test/test_aestag.c Outdated
Comment thread test/test_aestag.c Outdated
@gasbytes
gasbytes force-pushed the aes-ccm-gcm-iv-fixes branch from b1f0fde to a934c06 Compare July 13, 2026 16:50
@gasbytes
gasbytes marked this pull request as ready for review July 13, 2026 17:21
@gasbytes
gasbytes marked this pull request as draft July 13, 2026 17:44
…n set and add tests covering key-only (single-shot and streaming) operations
@gasbytes
gasbytes force-pushed the aes-ccm-gcm-iv-fixes branch from a934c06 to 61e7fcc Compare July 14, 2026 12:08
@gasbytes
gasbytes marked this pull request as ready for review July 14, 2026 12:20
@gasbytes

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please (timeout)

@gasbytes
gasbytes requested a review from ColtonWilley July 14, 2026 16:17
@gasbytes gasbytes assigned ColtonWilley and aidangarske and unassigned gasbytes Jul 14, 2026
@gasbytes
gasbytes requested a review from aidangarske July 14, 2026 16:17

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good

@aidangarske aidangarske removed their assignment Jul 14, 2026
@ColtonWilley ColtonWilley added the ci:all PR OSP toggle: run all label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:all PR OSP toggle: run all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants