Skip to content

Refactor: Disentangle Client_Hello implementations#5293

Merged
reneme merged 2 commits intorandombit:masterfrom
Rohde-Schwarz:refactor/tls12_13_client_hello
Feb 15, 2026
Merged

Refactor: Disentangle Client_Hello implementations#5293
reneme merged 2 commits intorandombit:masterfrom
Rohde-Schwarz:refactor/tls12_13_client_hello

Conversation

@reneme
Copy link
Copy Markdown
Collaborator

@reneme reneme commented Feb 6, 2026

See here for an overview of the related pull requests to disentangle TLS 1.2 and 1.3.

This moves the implementation of Client_Hello_12 into the tls12 module and Client_Hello_13 to tls13 likewise. To support downgrading the protocol version, the TLS 1.3 implementation needs to have a rudimentary understanding of the TLS 1.2 Client Hello. This is now implemented by the Client_Hello_12_Shim base class.

The only semantically relevant change is pulled into an independent commit. There is a 15 years old workaround (?) in the parsing of TLS 1.2 Client Hello messages that introduces a "fake extension" at parsing time when the "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" ciphersuite is offered but no Renegotiation_Extension was found in the original Client Hello. This code moved out of the Client_Hello_12_Shim and into the full-blown Client_Hello_12 class. Hence, the TLS 1.3 messages parsing tests now won't see this "fake extension" anymore, because they only use the Client_Hello_12_Shim to parse. The "workaround' isn't visible in TLS 1.3 any longer.

@copilot Most of this pull request is just moving code around without changing the implementations of the individual methods. Sometimes, small adjustments had to be done when certain aspects needed a different scope. Please create a detailed report on implementations and logic that didn't just move to make it easier for a human reviewer to follow what actually changes in this PR. Also: this PR contains two comments. The first is from #5292, please don't review this one one here.

Pull Request Dependencies

@reneme reneme self-assigned this Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 15:40
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 6, 2026

Coverage Status

coverage: 89.993% (-0.009%) from 90.002%
when pulling 9e05d7f on Rohde-Schwarz:refactor/tls12_13_client_hello
into 07ae08e on randombit:master.

This comment was marked as spam.

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.


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

@reneme
Copy link
Copy Markdown
Collaborator Author

reneme commented Feb 12, 2026

@copilot Please review again. Put an emphasis on finding semantic differences in the refactoring. Most code was merely moved into different modules but didn't actually change at all. The PR description points out one exception regarding a 15 years old workaround in the handling of the Renegotiation_Extension. Please confirm again that this holds true for the changes in this pull request and prepare a list of places where the implementations didn't just move around. This will hopefully help @randombit to assess this large changeset.

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

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


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

@reneme reneme force-pushed the refactor/tls12_13_client_hello branch from 3d9a3d2 to a06de2f Compare February 12, 2026 09:17
@reneme
Copy link
Copy Markdown
Collaborator Author

reneme commented Feb 13, 2026

@randombit if you don't mind looking into it: this PR and the next one in the stack (#5303) are essentially just moving stuff around like the ones that came before and are both ready to go.

Then, the actual feature (TLS 1.3 w/o 1.2 in #5318) would be free-standing and ready for review.

@randombit
Copy link
Copy Markdown
Owner

Too bad copilot was not willing to cooperate on this. But looks good to me.

This separates implementations of Client_Hello_12 and Client_Hello_13
into their respective modules tls12 and tls13. Since the TLS 1.3 code
must have a rudimentary understanding of the legacy Client Hello a new
Client_Hello_12_Shim is introduced. This facilitates protocol downgrades
from 1.3 to 1.2 when needed.
@reneme reneme force-pushed the refactor/tls12_13_client_hello branch from a06de2f to 9e05d7f Compare February 15, 2026 08:10
@reneme
Copy link
Copy Markdown
Collaborator Author

reneme commented Feb 15, 2026

Rebased once more because f9b4566

@reneme reneme merged commit a985be7 into randombit:master Feb 15, 2026
46 checks passed
@reneme reneme deleted the refactor/tls12_13_client_hello branch February 15, 2026 08:16
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.

4 participants