Skip to content

✨ Add gcm cipher mode to --aes/--camellia options#3193

Open
ChanTsune wants to merge 4 commits into
lib/feature/cipher-mode-2-gcmfrom
cli/feature/gcm-option
Open

✨ Add gcm cipher mode to --aes/--camellia options#3193
ChanTsune wants to merge 4 commits into
lib/feature/cipher-mode-2-gcmfrom
cli/feature/gcm-option

Conversation

@ChanTsune

Copy link
Copy Markdown
Owner

Stacked on #3192.

Summary

Expose cipher mode 2 (GCM) in the CLI as a gcm value for --aes/--camellia, with fuzz targets and compatibility test archives. The default cipher mode remains ctr; switching the default to gcm is a follow-up PR.

Notes

  • Wrong-password extraction of GCM archives now fails deterministically with an authentication error (CBC/CTR cannot detect this).
  • Adds a regression test pinning the default-off behavior for archived permissions on encrypted entries (spec recommendation for AEAD, §12.4.1).
  • New fixtures resources/test/*_gcm.pna; generation commands are recorded in the commit message. If ✨ Add Cipher mode 2 (AEAD, STREAM-based GCM) support to libpna #3192 changes the on-wire format during review, the fixtures must be regenerated.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12f4052e-c8ec-4e47-979a-989e443477b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cli/feature/gcm-option

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for the GCM cipher mode (AES-GCM and Camellia-GCM) across the CLI and library, complete with integration tests, compatibility tests, and new fuzz targets. The feedback recommends improving test robustness by asserting on the Display representation of errors (err.to_string()) rather than their Debug representation, which can be unstable.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cli/tests/cli/encrypt.rs
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file cli This issue is about cli application lib This issue is about lib crate labels Jul 11, 2026
@ChanTsune
ChanTsune force-pushed the cli/feature/gcm-option branch from 5c7e102 to fd5a0ff Compare July 16, 2026 08:25
@ChanTsune
ChanTsune force-pushed the lib/feature/cipher-mode-2-gcm branch 2 times, most recently from fe488f4 to 245251b Compare July 16, 2026 09:49
@ChanTsune
ChanTsune force-pushed the cli/feature/gcm-option branch from fd5a0ff to 372bb9c Compare July 16, 2026 09:49
@ChanTsune
ChanTsune force-pushed the lib/feature/cipher-mode-2-gcm branch from 245251b to 3ebe16d Compare July 16, 2026 11:11
@ChanTsune
ChanTsune force-pushed the cli/feature/gcm-option branch 2 times, most recently from f9d35b7 to fad79d5 Compare July 17, 2026 11:44
@ChanTsune
ChanTsune force-pushed the lib/feature/cipher-mode-2-gcm branch from 3ebe16d to b5a7c57 Compare July 17, 2026 11:44
Add zstd_aes_gcm.pna, zstd_camellia_gcm.pna, solid_zstd_aes_gcm.pna,
solid_zstd_camellia_gcm.pna, generated from the same resources/test/raw
input and "password" passphrase as the existing CBC/CTR fixtures, and
wire them into extract_compatibility.rs / extract_solid_compatibility.rs.

Generated with this branch's CLI, from resources/test/:

  pna create -f zstd_aes_gcm.pna              --no-keep-dir --zstd --aes gcm            --password password raw
  pna create -f zstd_camellia_gcm.pna         --no-keep-dir --zstd --camellia gcm       --password password raw
  pna create -f solid_zstd_aes_gcm.pna        --no-keep-dir --solid --zstd --aes gcm      --password password raw
  pna create -f solid_zstd_camellia_gcm.pna   --no-keep-dir --solid --zstd --camellia gcm --password password raw
Extracting a GCM-encrypted entry without --keep-permission must not
restore the archived mode, including the setuid bit.
@ChanTsune
ChanTsune force-pushed the cli/feature/gcm-option branch from fad79d5 to 7057a8b Compare July 18, 2026 06:51
@ChanTsune
ChanTsune force-pushed the lib/feature/cipher-mode-2-gcm branch from b5a7c57 to 30a8fe9 Compare July 18, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli This issue is about cli application dependencies Pull requests that update a dependency file lib This issue is about lib crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant