rustls::client::ech

Struct EchState

Source
pub(crate) struct EchState {
Show 13 fields pub(crate) outer_name: DnsName<'static>, pub(crate) early_data_key_schedule: Option<KeyScheduleEarly>, pub(crate) inner_hello_random: Random, pub(crate) inner_hello_transcript: HandshakeHashBuffer, secure_random: &'static dyn SecureRandom, sender: Box<dyn HpkeSealer>, config_id: u8, inner_name: ServerName<'static>, maximum_name_length: u8, cipher_suite: HpkeSymmetricCipherSuite, enc: EncapsulatedSecret, enable_sni: bool, sent_extensions: Vec<ExtensionType>,
}
Expand description

Contextual data for a TLS client handshake that has offered encrypted client hello (ECH).

Fields§

§outer_name: DnsName<'static>§early_data_key_schedule: Option<KeyScheduleEarly>§inner_hello_random: Random§inner_hello_transcript: HandshakeHashBuffer§secure_random: &'static dyn SecureRandom§sender: Box<dyn HpkeSealer>§config_id: u8§inner_name: ServerName<'static>§maximum_name_length: u8§cipher_suite: HpkeSymmetricCipherSuite§enc: EncapsulatedSecret§enable_sni: bool§sent_extensions: Vec<ExtensionType>

Implementations§

Source§

impl EchState

Source

pub(crate) fn new( config: &EchConfig, inner_name: ServerName<'static>, client_auth_enabled: bool, secure_random: &'static dyn SecureRandom, enable_sni: bool, ) -> Result<Self, Error>

Source

pub(crate) fn ech_hello( &mut self, outer_hello: ClientHelloPayload, retry_req: Option<&HelloRetryRequest>, resuming: &Option<Retrieved<&Tls13ClientSessionValue>>, ) -> Result<ClientHelloPayload, Error>

Construct a ClientHelloPayload offering ECH.

An outer hello, with a protected inner hello for the inner_name will be returned, and the ECH context will be updated to reflect the inner hello that was offered.

If retry_req is Some, then the outer hello will be constructed for a hello retry request.

If resuming is Some, then the inner hello will be constructed for a resumption handshake.

Source

pub(crate) fn confirm_acceptance( self, ks: &mut KeyScheduleHandshakeStart, server_hello: &ServerHelloPayload, hash: &'static dyn Hash, ) -> Result<Option<EchAccepted>, Error>

Confirm whether an ECH offer was accepted based on examining the server hello.

Source

pub(crate) fn confirm_hrr_acceptance( &self, hrr: &HelloRetryRequest, cs: &Tls13CipherSuite, common: &mut CommonState, ) -> Result<bool, Error>

Source

pub(crate) fn transcript_hrr_update( &mut self, hash: &'static dyn Hash, m: &Message<'_>, )

Update the ECH context inner hello transcript based on a received hello retry request message.

This will start the in-progress transcript using the given hash, convert it into an HRR buffer, and then add the hello retry message m.

Source

fn encode_inner_hello( &mut self, outer_hello: &ClientHelloPayload, retryreq: Option<&HelloRetryRequest>, resuming: &Option<Retrieved<&Tls13ClientSessionValue>>, ) -> Vec<u8>

Source

fn grease_psk(&self, psk_offer: &mut PresharedKeyOffer) -> Result<(), Error>

Source

fn server_hello_conf(server_hello: &ServerHelloPayload) -> Message<'_>

Source

fn hello_retry_request_conf(retry_req: &HelloRetryRequest) -> Message<'_>

Source

fn ech_conf_message(hmp: HandshakeMessagePayload<'_>) -> Message<'_>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.