pub trait QuicExt {
// Required methods
fn quic_transport_parameters(&self) -> Option<&[u8]>;
fn zero_rtt_keys(&self) -> Option<DirectionalKeys>;
fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>;
fn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>;
fn alert(&self) -> Option<AlertDescription>;
}
Expand description
Generic methods for QUIC sessions
Required Methods§
sourcefn quic_transport_parameters(&self) -> Option<&[u8]>
fn quic_transport_parameters(&self) -> Option<&[u8]>
Return the TLS-encoded transport parameters for the session’s peer.
While the transport parameters are technically available prior to the completion of the handshake, they cannot be fully trusted until the handshake completes, and reliance on them should be minimized. However, any tampering with the parameters will cause the handshake to fail.
sourcefn zero_rtt_keys(&self) -> Option<DirectionalKeys>
fn zero_rtt_keys(&self) -> Option<DirectionalKeys>
Compute the keys for encrypting/decrypting 0-RTT packets, if available
sourcefn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>
fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>
Consume unencrypted TLS handshake data.
Handshake data obtained from separate encryption levels should be supplied in separate calls.
sourcefn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>
fn write_hs(&mut self, buf: &mut Vec<u8>) -> Option<KeyChange>
Emit unencrypted TLS handshake data.
When this returns Some(_)
, the new keys must be used for future handshake data.
sourcefn alert(&self) -> Option<AlertDescription>
fn alert(&self) -> Option<AlertDescription>
Emit the TLS description code of a fatal alert, if one has arisen.
Check after read_hs
returns Err(_)
.