Skip to content

Add opt-in single-update AES-GCM for non-streaming builds - #529

Merged
padelsbach merged 2 commits into
masterfrom
colton/gcm-single-update-optin-20261110
Nov 10, 2026
Merged

padelsbach merged 2 commits into
masterfrom
colton/gcm-single-update-optin-20261110

Conversation

@ColtonWilley

@ColtonWilley ColtonWilley commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Adds an opt-in wolfprov-gcm-single-update context parameter for non-streaming AES-GCM builds such as FIPS v5. A caller that opts in passes the complete payload in one Update, setting the expected tag first when decrypting, so wolfProvider calls wolfCrypt one-shot instead of caching and replaying the payload. Existing callers are unchanged.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 19:40

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.

🟡 Changes recommended

A rejected tag replacement can leave strict decryption using invalid tag bytes, and the interoperability tests may fail to obtain an independent OpenSSL reference or silently compare wolfCrypt against itself.

2 open issues
What changed in this PR

Adds an opt-in single-update AES-GCM contract to avoid payload-prefix replay in nonstreaming wolfCrypt builds, while preserving the ordinary EVP path.

Changes:

  • Adds capability discovery, authenticated single-update processing, and operation-state guards.
  • Registers interoperability and ordinary split-update, reuse, and TLS regression tests.
  • Documents the contract, test modes, and release-validation limits.
File Description
test/​test_gcm_single_update.c Adds interoperability vectors and contract-edge checks.
test/​test_gcm_ordinary_compat.c Adds ordinary GCM reuse, split-update, and TLS regressions.
test/​include.am Registers both test programs with make check.
src/​wp_aes_aead.c Implements the optional nonstreaming GCM contract.
docs/​GCM_SINGLE_UPDATE.md Documents usage, exclusions, and validation requirements.

Review effort: Balanced

Comment thread src/wp_aes_aead.c Resolved
Comment thread test/test_gcm_single_update.c Resolved
@ColtonWilley
ColtonWilley force-pushed the colton/gcm-single-update-optin-20261110 branch from 4c3164f to c44ab88 Compare November 10, 2026 20:03
@ColtonWilley ColtonWilley changed the title Add opt-in single-update AES-GCM contract for nonstreaming modules Add opt-in single-update AES-GCM for non-streaming builds Nov 10, 2026
Callers that set wolfprov-gcm-single-update pass the complete payload in one
Update, with the expected tag set first when decrypting. wolfProvider then
calls wolfCrypt one-shot instead of caching and replaying the payload.
Ordinary callers are unchanged.
@ColtonWilley
ColtonWilley force-pushed the colton/gcm-single-update-optin-20261110 branch from c44ab88 to 5d613c3 Compare November 10, 2026 20:04
Comment thread test/test_aestag.c Resolved
Comment thread src/wp_aes_aead.c Resolved
Comment thread src/wp_aes_aead.c Resolved
Comment thread test/test_aestag.c Resolved
Comment thread test/test_aestag.c Resolved
Move WP_PARAM_GCM_SINGLE_UPDATE to wp_wolfprov.h, follow the ok/WOLFPROV_LEAVE
pattern without early returns, document the new fields and function, and test
an empty Final and decrypt without a tag on a reused context.
@padelsbach
padelsbach merged commit f912d77 into master Nov 10, 2026
82 checks passed
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.

4 participants