Skip to content

tls: Rename TLS groups preferences flag#151

Open
ormergi wants to merge 1 commit into
kubevirt:mainfrom
ormergi:tls-fix-flag-name
Open

tls: Rename TLS groups preferences flag#151
ormergi wants to merge 1 commit into
kubevirt:mainfrom
ormergi:tls-fix-flag-name

Conversation

@ormergi
Copy link
Copy Markdown
Contributor

@ormergi ormergi commented May 3, 2026

What this PR does / why we need it:
The flag 'tls-curve-preferences' controls which key-exchange algorithm group
to use for TLS session. Its name follows the legacy 'curves' terminology.
Initially the TLS parameter for the key-exchange algorithm groups used to
support elliptic curves only; a specific groups of algorithms.
In newer versions (1.3) it was extended to support other groups
(non-elliptic curve) [1] [2].
Although Go crypto use the same field for non-elliptic curve groups [3].

Rename the flag to follow the correct TLS terminology.

[1] https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8 (see "Renamed from" note)
[2] https://www.rfc-editor.org/rfc/rfc8446.html#section-4.2.7
[3] https://pkg.go.dev/crypto/tls@go1.25.9#CurveID

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:


@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label May 3, 2026
@kubevirt-bot kubevirt-bot requested review from oshoval and qinqon May 3, 2026 07:53
@kubevirt-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign qinqon for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the naming convention for the TLS configuration flag responsible for key-exchange algorithm groups. By shifting from 'curve' to 'group' terminology, the codebase now more accurately reflects the broader support for non-elliptic curve groups introduced in newer TLS versions, ensuring consistency with current industry standards and Go's cryptographic library.

Highlights

  • Flag Renaming: Renamed the 'tls-curve-preferences' flag to 'tls-group-preferences' to better align with modern TLS terminology.
  • Documentation Update: Updated the flag help text to reflect the new name and include non-elliptic curve examples like X25519MLKEM768.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 renames TLS curve preference variables and the CLI flag to use 'group' terminology, aligning with modern TLS standards and adding support for the X25519MLKEM768 group. Feedback suggests maintaining backward compatibility by keeping the old flag as a deprecated alias and further updating internal helper functions and error messages to use 'group' instead of 'curve' for consistency.

Comment thread cmd/main.go
Comment on lines +96 to +98
flag.StringVar(&tlsGroupPreferencesRaw, "tls-group-preferences", "",
`Comma-separated list of TLS group preference names.
Supported values are tls package constants names (e.g. X25519MLKEM768, CurveP256)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Renaming the CLI flag --tls-curve-preferences to --tls-group-preferences is a breaking change for users and automation. To maintain backward compatibility, consider keeping the old flag name as a deprecated alias that points to the same variable. This allows for a smoother transition.

Copy link
Copy Markdown
Contributor Author

@ormergi ormergi May 3, 2026

Choose a reason for hiding this comment

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

This is safe because we are still in a middle of development cycle, this is not expected to be used by anyone.
Lets see what the maintainers think.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@gemini-code-assist this is safe. We can break this unreleased API - if we move now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood. Since this is an unreleased API and the change is intentional for better alignment with TLS terminology, proceeding without a deprecated alias is acceptable in this context.

Comment thread pkg/config/tls.go Outdated
The flag 'tls-curve-preferences' controls which key-exchange algorithm group
to use for TLS session. Its name follows the legacy  'curves' terminology.
Initially the TLS parameter for the key-exchange algorithm groups used to
support elliptic curves only; a specific groups of algorithms.
In newer versions (1.3) it was extended to support other groups
(non-elliptic curve) [1] [2].
Although Go crypto use the same field for non-elliptic curve groups [3].

Rename the flag and releted components to follow the correct TLS terminology.

[1] https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8 (see "Renamed from" note)
[2] https://www.rfc-editor.org/rfc/rfc8446.html#section-4.2.7
[3] https://pkg.go.dev/crypto/tls@go1.25.9#CurveID

Signed-off-by: Or Mergi <ormergi@redhat.com>
@ormergi ormergi force-pushed the tls-fix-flag-name branch from 623a7ce to c94843d Compare May 3, 2026 08:25
Copy link
Copy Markdown
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Tks for this.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2026
@ormergi
Copy link
Copy Markdown
Contributor Author

ormergi commented May 6, 2026

@qinqon could you please have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants