Skip to content

Conversation

@TheBestTvarynka
Copy link
Collaborator

Hi,
I fixed TLS 1.3 support in TSSSP implementation:

  • Added CipherSuite::TLS13_AES_256_GCM_SHA384 support.
  • Fixed TLS packet header validation: TLS 1.3 uses TLS 1.2 version in the packet header.

Fix TLS packet header validation: TLS 1.3 uses the TLS 1.2 version
number in the packet header.
@TheBestTvarynka TheBestTvarynka self-assigned this Nov 6, 2025
@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review November 6, 2025 10:44
Comment on lines 250 to 256
let tls_version: u16 = if tls_version == ProtocolVersion::TLSv1_3 {
// TLS 1.3 uses the same version number as TLS 1.2 in the record layer.
ProtocolVersion::TLSv1_2
} else {
tls_version
}
.into();
Copy link
Member

Choose a reason for hiding this comment

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

style (non-blocking): avoid this kind of into(). I recommend u16::from in a readable way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

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

LGTM!

@CBenoit CBenoit requested a review from Copilot November 6, 2025 10:52
Copy link

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

This PR adds TLS 1.3 support to the CredSSP TLS connection handling by properly handling TLS 1.3 version numbers in record layer headers and adding support for the TLS 1.3 AES-256-GCM cipher suite.

Key changes:

  • TLS 1.3 record layer version handling (maps TLS 1.3 to TLS 1.2 version number per RFC 8446)
  • Enhanced error messages with actual vs expected packet header debugging information
  • Added TLS13_AES_256_GCM_SHA384 cipher suite support

Reviewed Changes

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

File Description
src/credssp/sspi_cred_ssp/tls_connection.rs Adds TLS 1.3 version handling logic that maps TLS 1.3 to TLS 1.2 version in record headers, and improves error messages with debugging information
src/credssp/sspi_cred_ssp/cipher_block_size.rs Adds TLS13_AES_256_GCM_SHA384 cipher suite to the supported block cipher list

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

Comment on lines 266 to 267
&payload[0..3],
tls_packet_start
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The order of arguments in the error message is reversed compared to the other similar error message in the same file. At line 207-209, the format shows 'expected tls_packet_start but got payload[0..3]', but here at line 266-267 it's reversed. This inconsistency could confuse debugging. Both error messages should have the same order: 'expected {expected_value} but got {actual_value}'.

Suggested change
&payload[0..3],
tls_packet_start
tls_packet_start,
&payload[0..3]

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Good catch

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@CBenoit
Copy link
Member

CBenoit commented Nov 6, 2025

question: Is this a new feature? Should probably be feat(sspi): support for TLS 1.3 in tsssp module.

@TheBestTvarynka
Copy link
Collaborator Author

TheBestTvarynka commented Nov 6, 2025

Is this a new feature?

I wouldn't call it that. I expected TLS 1.3 to work correctly before 😅 There was no reason why it wouldn't work. I only fixed it.

But if you still wish to change the PR title, then I don't mind changing it :)

@CBenoit CBenoit changed the title fix(sspi): tsssp: TLS 1.3 support fix(sspi): TLS 1.3 support in tsssp module Nov 6, 2025
@CBenoit
Copy link
Member

CBenoit commented Nov 6, 2025

Makes sense to stick to fix in that case! Thank you

@CBenoit CBenoit merged commit 0605cf0 into master Nov 6, 2025
63 checks passed
@CBenoit CBenoit deleted the fix/tssp-tls1.3-support branch November 6, 2025 16:22
@CBenoit CBenoit changed the title fix(sspi): TLS 1.3 support in tsssp module fix(sspi): TLS 1.3 support in TSSSP module Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants