Skip to content

feat(startauthsession): Add support full symmetric algorithm/bits/mode combinations#22

Merged
hyperfinitism merged 1 commit intomainfrom
feature/add-full-sym-enc-types
Mar 28, 2026
Merged

feat(startauthsession): Add support full symmetric algorithm/bits/mode combinations#22
hyperfinitism merged 1 commit intomainfrom
feature/add-full-sym-enc-types

Conversation

@hyperfinitism
Copy link
Copy Markdown
Owner

@hyperfinitism hyperfinitism commented Mar 28, 2026

This pull request expands and refactors the parsing function of symmetric algorithm definitions for session encryption (the --symmetric argument in startauthsession). The changes add support for additional algorithms and key sizes, clarify accepted input formats.

Instead of only supporting the two constants (AES_128_CFB, AES_256_CFB) pre-defined in the upstream tss-esapi and XOR (with SHA256), parse a structured "algo-bits-mode" format that covers all symmetric algorithms available in tss-esapi:

  • AES with 128/192/256 key bits and CFB/CBC/ECB/OFB/CTR modes
  • SM4 with 128 key bits and all modes
  • Camellia with 128/192/256 key bits and all modes
  • XOR with any supported hash algorithm (xor-sha256, etc.)
  • null

Legacy shorthand forms (aes128cfb, aes256cfb and xor) remain accepted for backwards compatibility.

@hyperfinitism hyperfinitism requested a review from Copilot March 28, 2026 05:30
@hyperfinitism hyperfinitism self-assigned this Mar 28, 2026
@hyperfinitism hyperfinitism added the enhancement New feature or request label Mar 28, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

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 refactors the symmetric algorithm parsing logic to support a wider range of algorithms, including SM4 and Camellia, and updates the command-line documentation accordingly. While legacy shorthands for AES were preserved, the refactoring introduced a breaking change by removing the 'xor' shorthand (which previously defaulted to SHA-256); this should be restored to maintain backwards compatibility.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Expands startauthsession --symmetric parsing to support a structured algo-bits-mode (and xor-<hash>) format that covers more of the tss-esapi symmetric definitions while keeping some legacy input compatibility.

Changes:

  • Refactors parse_symmetric_definition to parse aes|sm4|camellia-<bits>-<mode> and xor-<hash> (plus null).
  • Adds key-bits type imports needed to construct structured SymmetricDefinition variants.
  • Updates startauthsession CLI help text to reflect the expanded accepted formats.

Reviewed changes

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

File Description
src/parse.rs Reworks symmetric definition parsing to support additional algorithms/key sizes/modes and xor-<hash>.
src/cmd/startauthsession.rs Updates --symmetric argument help to show new accepted input formats.

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b42ffd309

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@hyperfinitism hyperfinitism force-pushed the feature/add-full-sym-enc-types branch 5 times, most recently from 694e28b to c2bb907 Compare March 28, 2026 06:06
Instead of only supporting the two constants (AES_128_CFB and AES_256_CFB)
pre-defined in the upstream tss-esapi and the manually defined XOR, parse
a structured "algo-bits-mode" format that covers all symmetric algorithms
available in tss-esapi:

- AES with 128/192/256 key bits and CFB/CBC/ECB/OFB/CTR modes
- SM4 with 128 key bits and all modes
- Camellia with 128/192/256 key bits and all modes
- XOR with any supported hash algorithm (xor-sha256, etc.)
- null

Legacy shorthand forms ("aes128cfb", "aes256cfb" and "xor") remain accepted
for backwards compatibility.

Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
@hyperfinitism hyperfinitism force-pushed the feature/add-full-sym-enc-types branch from c2bb907 to b028165 Compare March 28, 2026 06:14
@hyperfinitism hyperfinitism merged commit 55cb0ef into main Mar 28, 2026
22 checks passed
@hyperfinitism hyperfinitism deleted the feature/add-full-sym-enc-types branch March 28, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants