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
impl EchState
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>
Sourcepub(crate) fn ech_hello(
&mut self,
outer_hello: ClientHelloPayload,
retry_req: Option<&HelloRetryRequest>,
resuming: &Option<Retrieved<&Tls13ClientSessionValue>>,
) -> Result<ClientHelloPayload, Error>
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.
Sourcepub(crate) fn confirm_acceptance(
self,
ks: &mut KeyScheduleHandshakeStart,
server_hello: &ServerHelloPayload,
hash: &'static dyn Hash,
) -> Result<Option<EchAccepted>, Error>
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.
pub(crate) fn confirm_hrr_acceptance( &self, hrr: &HelloRetryRequest, cs: &Tls13CipherSuite, common: &mut CommonState, ) -> Result<bool, Error>
Sourcepub(crate) fn transcript_hrr_update(
&mut self,
hash: &'static dyn Hash,
m: &Message<'_>,
)
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
.