Skip to content

Require fresh IVs for EVP ARIA GCM - #11594

Open
aidangarske wants to merge 5 commits into
wolfSSL:masterfrom
aidangarske:evp-aria-gcm-iv-state
Open

aidangarske wants to merge 5 commits into
wolfSSL:masterfrom
aidangarske:evp-aria-gcm-iv-state

Conversation

@aidangarske

Copy link
Copy Markdown
Member

@aidangarske aidangarske self-assigned this Sep 29, 2026
Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:35

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 High severity · 2 Medium severity

Open (4)
What changed in this PR

This PR tightens ARIA-GCM EVP usage by requiring a fresh IV per message and tracking IV consumption across operations, addressing ticket H22/H23.

Changes:

  • Add authIvUsed tracking to EVP cipher contexts for ARIA-GCM flows.
  • Enforce “IV must be set and unused” checks in ARIA-GCM encryption paths, failing when violated.
  • Add API tests covering “IV required” and “new IV per message” behavior for ARIA-GCM.
File Description
wolfssl/​openssl/​evp.h Extends WOLFSSL_EVP_CIPHER_CTX to support ARIA IV sizing and adds authIvUsed state bit.
wolfcrypt/​src/​evp.c Implements ARIA-GCM IV freshness checks and updates authIvUsed transitions across encrypt operations.
tests/​api/​test_evp_cipher.h Registers two new ARIA-GCM IV behavior tests.
tests/​api/​test_evp_cipher.c Adds test coverage for missing-IV failure and per-message IV enforcement for ARIA-GCM.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread wolfcrypt/src/evp.c Resolved
Comment thread wolfcrypt/src/evp.c Resolved
Comment thread wolfcrypt/src/evp.c Resolved
Comment thread wolfssl/openssl/evp.h Resolved

@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 #11594

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 2 of 3 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_evp_cipher.c

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Lite

Comment thread wolfcrypt/src/evp.c Resolved
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Comment thread wolfcrypt/src/evp.c Resolved
Comment thread wolfcrypt/src/evp.c Resolved

@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 #11594

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 2 of 2 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: Lite

Comment thread wolfcrypt/src/evp.c
ctx->authIvUsed = 0;
else if (type != NULL)
ctx->authIvUsed = 1;
}

@philljj philljj Oct 15, 2026 •

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.

This is pre-existing, but while we're here could you correct this endif comment

    #endif /* HAVE_AESGCM && ((!HAVE_FIPS && !HAVE_SELFTEST) ||
            * HAVE_FIPS_VERSION >= 2 */

comment to match the opening

    #if defined(HAVE_ARIA)

Also, this branch is 795 commits behind master, and it's a good excuse to rebase just to be safe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed the endif comment to HAVE_ARIA and rebased on current master.

@philljj philljj assigned aidangarske and unassigned wolfSSL-Bot Oct 15, 2026
@aidangarske
aidangarske force-pushed the evp-aria-gcm-iv-state branch from 13f8f3a to d11376a Compare November 6, 2026 21:31
@aidangarske
aidangarske requested a review from philljj November 6, 2026 21:32
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.

6 participants