feat(startauthsession): Add support full symmetric algorithm/bits/mode combinations#22
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_definitionto parseaes|sm4|camellia-<bits>-<mode>andxor-<hash>(plusnull). - Adds key-bits type imports needed to construct structured
SymmetricDefinitionvariants. - Updates
startauthsessionCLI 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.
There was a problem hiding this comment.
💡 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".
694e28b to
c2bb907
Compare
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>
c2bb907 to
b028165
Compare
This pull request expands and refactors the parsing function of symmetric algorithm definitions for session encryption (the
--symmetricargument instartauthsession). 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 upstreamtss-esapiand XOR (with SHA256), parse a structured "algo-bits-mode" format that covers all symmetric algorithms available in tss-esapi:Legacy shorthand forms (
aes128cfb,aes256cfbandxor) remain accepted for backwards compatibility.