-
Notifications
You must be signed in to change notification settings - Fork 574
Expose TLS Group through MsQuic API #5030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nibanks
commented
Apr 19, 2025
CargoThe rust bindings need to be updated. Please apply ( diff --git a/src/rs/ffi/linux_bindings.rs b/src/rs/ffi/linux_bindings.rs
index 3a7af63..e812b9e 100644
--- a/src/rs/ffi/linux_bindings.rs
+++ b/src/rs/ffi/linux_bindings.rs
@@ -718,6 +718,17 @@ pub type QUIC_HASH_ALGORITHM = ::std::os::raw::c_uint;
pub const QUIC_KEY_EXCHANGE_ALGORITHM_QUIC_KEY_EXCHANGE_ALGORITHM_NONE:
QUIC_KEY_EXCHANGE_ALGORITHM = 0;
pub type QUIC_KEY_EXCHANGE_ALGORITHM = ::std::os::raw::c_uint;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_NONE: QUIC_TLS_GROUP = 0;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP256R1: QUIC_TLS_GROUP = 23;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP384R1: QUIC_TLS_GROUP = 24;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_X25519: QUIC_TLS_GROUP = 29;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM512: QUIC_TLS_GROUP = 512;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM768: QUIC_TLS_GROUP = 513;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM1024: QUIC_TLS_GROUP = 514;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP256R1MLKEM768: QUIC_TLS_GROUP = 4587;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_X25519MLKEM768: QUIC_TLS_GROUP = 4588;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP384R1MLKEM1024: QUIC_TLS_GROUP = 4589;
+pub type QUIC_TLS_GROUP = ::std::os::raw::c_uint;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_128_GCM_SHA256: QUIC_CIPHER_SUITE = 4865;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_256_GCM_SHA384: QUIC_CIPHER_SUITE = 4866;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_CHACHA20_POLY1305_SHA256: QUIC_CIPHER_SUITE =
@@ -741,10 +752,11 @@ pub struct QUIC_HANDSHAKE_INFO {
pub KeyExchangeAlgorithm: QUIC_KEY_EXCHANGE_ALGORITHM,
pub KeyExchangeStrength: i32,
pub CipherSuite: QUIC_CIPHER_SUITE,
+ pub TlsGroup: QUIC_TLS_GROUP,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
- ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::<QUIC_HANDSHAKE_INFO>() - 32usize];
+ ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::<QUIC_HANDSHAKE_INFO>() - 36usize];
["Alignment of QUIC_HANDSHAKE_INFO"][::std::mem::align_of::<QUIC_HANDSHAKE_INFO>() - 4usize];
["Offset of field: QUIC_HANDSHAKE_INFO::TlsProtocolVersion"]
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsProtocolVersion) - 0usize];
@@ -762,6 +774,8 @@ const _: () = {
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeStrength) - 24usize];
["Offset of field: QUIC_HANDSHAKE_INFO::CipherSuite"]
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherSuite) - 28usize];
+ ["Offset of field: QUIC_HANDSHAKE_INFO::TlsGroup"]
+ [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsGroup) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)] |
CargoThe rust bindings need to be updated. Please apply ( diff --git a/src/rs/ffi/win_bindings.rs b/src/rs/ffi/win_bindings.rs
index 7963fe1..421fbe4 100644
--- a/src/rs/ffi/win_bindings.rs
+++ b/src/rs/ffi/win_bindings.rs
@@ -712,6 +712,17 @@ pub type QUIC_HASH_ALGORITHM = ::std::os::raw::c_int;
pub const QUIC_KEY_EXCHANGE_ALGORITHM_QUIC_KEY_EXCHANGE_ALGORITHM_NONE:
QUIC_KEY_EXCHANGE_ALGORITHM = 0;
pub type QUIC_KEY_EXCHANGE_ALGORITHM = ::std::os::raw::c_int;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_NONE: QUIC_TLS_GROUP = 0;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP256R1: QUIC_TLS_GROUP = 23;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP384R1: QUIC_TLS_GROUP = 24;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_X25519: QUIC_TLS_GROUP = 29;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM512: QUIC_TLS_GROUP = 512;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM768: QUIC_TLS_GROUP = 513;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_MLKEM1024: QUIC_TLS_GROUP = 514;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP256R1MLKEM768: QUIC_TLS_GROUP = 4587;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_X25519MLKEM768: QUIC_TLS_GROUP = 4588;
+pub const QUIC_TLS_GROUP_QUIC_TLS_GROUP_SECP384R1MLKEM1024: QUIC_TLS_GROUP = 4589;
+pub type QUIC_TLS_GROUP = ::std::os::raw::c_int;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_128_GCM_SHA256: QUIC_CIPHER_SUITE = 4865;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_256_GCM_SHA384: QUIC_CIPHER_SUITE = 4866;
pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_CHACHA20_POLY1305_SHA256: QUIC_CIPHER_SUITE =
@@ -735,10 +746,11 @@ pub struct QUIC_HANDSHAKE_INFO {
pub KeyExchangeAlgorithm: QUIC_KEY_EXCHANGE_ALGORITHM,
pub KeyExchangeStrength: i32,
pub CipherSuite: QUIC_CIPHER_SUITE,
+ pub TlsGroup: QUIC_TLS_GROUP,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
- ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::<QUIC_HANDSHAKE_INFO>() - 32usize];
+ ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::<QUIC_HANDSHAKE_INFO>() - 36usize];
["Alignment of QUIC_HANDSHAKE_INFO"][::std::mem::align_of::<QUIC_HANDSHAKE_INFO>() - 4usize];
["Offset of field: QUIC_HANDSHAKE_INFO::TlsProtocolVersion"]
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsProtocolVersion) - 0usize];
@@ -756,6 +768,8 @@ const _: () = {
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeStrength) - 24usize];
["Offset of field: QUIC_HANDSHAKE_INFO::CipherSuite"]
[::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherSuite) - 28usize];
+ ["Offset of field: QUIC_HANDSHAKE_INFO::TlsGroup"]
+ [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsGroup) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)] |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5030 +/- ##
==========================================
- Coverage 87.19% 87.01% -0.18%
==========================================
Files 59 59
Lines 17927 17927
==========================================
- Hits 15632 15600 -32
- Misses 2295 2327 +32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
anrossi
reviewed
Apr 24, 2025
anrossi
approved these changes
Apr 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The TLS group is useful to understand exactly what level of security is being negotiated during the TLS handshake. For instance, this allows perf tests to ensure they are apples to apples.
On a side note, OpenSSL negotiates weaker/simpler/less-CPU-intensive groups by default which is why their HPS numbers were so high. A follow up PR needs to fix that.
Testing
Local testing
Documentation
Added some minimal docs.