Skip to content

Commit

Permalink
crypto: expose negotiated_key_exchange_group in the handshake data
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-gt committed Nov 18, 2024
1 parent a694602 commit d27d325
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quinn-proto/src/crypto/rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustls::{
client::danger::ServerCertVerifier,
pki_types::{CertificateDer, PrivateKeyDer, ServerName},
quic::{Connection, HeaderProtectionKey, KeyChange, PacketKey, Secrets, Suite, Version},
CipherSuite,
CipherSuite, NamedGroup,
};

use crate::{
Expand Down Expand Up @@ -64,6 +64,11 @@ impl crypto::Session for TlsSession {
Connection::Client(_) => None,
Connection::Server(ref session) => session.server_name().map(|x| x.into()),
},
negotiated_key_exchange_group: self
.inner
.negotiated_key_exchange_group()
.expect("key exchange group is negotiated")
.name(),
}))
}

Expand Down Expand Up @@ -256,6 +261,8 @@ pub struct HandshakeData {
///
/// Always `None` for outgoing connections
pub server_name: Option<String>,
/// The key exchange group negotiated with the peer
pub negotiated_key_exchange_group: NamedGroup,
}

/// A QUIC-compatible TLS client configuration
Expand Down

0 comments on commit d27d325

Please sign in to comment.