Skip to content

fix GCM tls iv length check and aead tag length validation#416

Open
gasbytes wants to merge 2 commits into
wolfSSL:masterfrom
gasbytes:wp-aes-aead-fixes
Open

fix GCM tls iv length check and aead tag length validation#416
gasbytes wants to merge 2 commits into
wolfSSL:masterfrom
gasbytes:wp-aes-aead-fixes

Conversation

@gasbytes

Copy link
Copy Markdown

Fixes the gcm tls fixed-iv length check to properly reject oversized inputs and adds tag length validation against each algorithm's allowed sizes for GCM and CCM, in particular this last one was wrapped in a new function called wp_aead_tag_len_valid.

@gasbytes gasbytes self-assigned this Jun 25, 2026
Copilot AI review requested due to automatic review settings June 25, 2026 16:41

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 AES-GCM/TLS fixed-IV handling and AEAD tag-length validation in wp_aes_aead.c, and adds unit tests to prevent regressions around oversized fixed-IV inputs and undersized authentication tags.

Changes:

  • Add wp_aead_tag_len_valid() and enforce algorithm-specific allowed tag sizes for GCM and CCM when setting OSSL_CIPHER_PARAM_AEAD_TAG.
  • Fix AES-GCM TLS fixed-IV length validation to reject oversized fixed-IV lengths (including those exceeding the configured IV length).
  • Add new unit tests covering oversized GCM TLS fixed-IV inputs and undersized tag-length rejection for both GCM and CCM.

Reviewed changes

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

File Description
test/unit.h Declares new GCM/CCM regression tests.
test/unit.c Registers the new tests in the unit test suite.
test/test_aestag.c Implements new test cases for oversized TLS fixed-IV and undersized tag length rejection.
src/wp_aes_aead.c Adds tag-length validation helper and tightens GCM TLS fixed-IV length checks.

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

Comment thread src/wp_aes_aead.c
Comment thread test/test_aestag.c
@gasbytes gasbytes force-pushed the wp-aes-aead-fixes branch from aececf4 to 4f8d057 Compare June 25, 2026 17:03
@gasbytes gasbytes marked this pull request as ready for review June 25, 2026 17:18
@gasbytes gasbytes assigned ColtonWilley and unassigned gasbytes Jun 25, 2026
@gasbytes gasbytes requested a review from ColtonWilley June 25, 2026 18:16
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