Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions rustls/src/client/client_conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::{fmt, mem};
use pki_types::{ServerName, UnixTime};

use super::handy::NoClientSessionStorage;
use super::hs;
use super::hs::{self, ClientHelloInput};
#[cfg(feature = "std")]
use crate::WantsVerifier;
use crate::builder::ConfigBuilder;
Expand Down Expand Up @@ -844,7 +844,7 @@ impl ConnectionCore<ClientConnectionData> {
pub(crate) fn for_client(
config: Arc<ClientConfig>,
name: ServerName<'static>,
extra_exts: ClientExtensionsInput<'_>,
extra_exts: ClientExtensionsInput<'static>,
proto: Protocol,
) -> Result<Self, Error> {
let mut common_state = CommonState::new(Side::Client);
Expand All @@ -861,7 +861,8 @@ impl ConnectionCore<ClientConnectionData> {
sendable_plaintext: None,
};

let state = hs::start_handshake(name, extra_exts, config, &mut cx)?;
let input = ClientHelloInput::new(name, &extra_exts, &mut cx, config)?;
let state = input.start_handshake(extra_exts, &mut cx)?;
Ok(Self::new(state, data, common_state))
}

Expand Down
20 changes: 18 additions & 2 deletions rustls/src/client/ech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use crate::tls13::key_schedule::{
KeyScheduleEarly, KeyScheduleHandshakeStart, server_ech_hrr_confirmation_secret,
};
use crate::{
AlertDescription, CommonState, EncryptedClientHelloError, Error, PeerIncompatible,
PeerMisbehaved, ProtocolVersion, Tls13CipherSuite,
AlertDescription, ClientConfig, CommonState, EncryptedClientHelloError, Error,
PeerIncompatible, PeerMisbehaved, ProtocolVersion, Tls13CipherSuite,
};

/// Controls how Encrypted Client Hello (ECH) is used in a client handshake.
Expand Down Expand Up @@ -157,6 +157,22 @@ impl EchConfig {
Err(EncryptedClientHelloError::NoCompatibleConfig.into())
}

pub(super) fn state(
&self,
server_name: ServerName<'static>,
config: &ClientConfig,
) -> Result<EchState, Error> {
EchState::new(
self,
server_name.clone(),
config
.client_auth_cert_resolver
.has_certs(),
config.provider.secure_random,
config.enable_sni,
)
}

/// Compute the HPKE `SetupBaseS` `info` parameter for this ECH configuration.
///
/// See <https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-17#section-6.1>.
Expand Down
Loading
Loading