Skip to main content

ServerHandshakeCtx

Struct ServerHandshakeCtx 

Source
pub struct ServerHandshakeCtx<Config, Crypto, Rng> { /* private fields */ }
Expand description

State machine context for yTLS Server

Implementations§

Source§

impl<Config, Crypto, Rng> ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source

pub fn with_required(config: Config, crypto: Crypto, rng: Rng) -> Self

New yTLS server context with the given configuration

Trait Implementations§

Source§

impl<Config, Crypto, Rng> ClientHelloProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn handle_extension(&mut self, ext_id: u16, ext_data: &[u8])

Source§

fn handle_cipher_suite(&mut self, cipher_suite: &[u8; 2])

Source§

fn handle_client_random(&mut self, cr: &[u8; 32])

Source§

fn handle_session_id(&mut self, ses_id: &[u8])

Source§

impl<Config, Crypto, Rng> CtxHandshakeProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn spin_handshake<Li: TlsLeftIn, Lo: TlsLeftOut, Ks: SecretStore>( &mut self, li: &mut Li, lo: &mut Lo, ks: &mut Ks, ) -> Result<Option<HandshakeComplete>, Self::Error>

Spin yTLS Server Handshake Context

Source§

type Error = CtxError

Source§

impl<Config, Crypto, Rng> ExtAlpnProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn alpn<'r>(&mut self, alpn: Alpn<'r>) -> bool

Source§

impl<Config, Crypto, Rng> ExtCompressCertProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn compress_certificate(&mut self, _alg: CertificateCompressKind)

Client indicates support for a given Certificate Compression algorithm.
Source§

impl<Config, Crypto, Rng> ExtDelegatedCredentialProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn delegated_credential_signature_algorithm( &mut self, _sa: SignatureAlgorithm, ) -> bool

Indicate support for the given Signature Algorithm.
Source§

impl<Config, Crypto, Rng> ExtEncryptedClientHelloProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn encrypted_client_hello_outer( &mut self, _config_id: u8, _kdf: HkdfKind, _aead: HaeadKind, _enc: &[u8], _payload: &[u8], )

Encrypted Client Hello Outer
Source§

impl<Config, Crypto, Rng> ExtGroupProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn group(&mut self, group: Group) -> bool

Check whether any of the provided groups matches. When any of the entries matches, result will be true and otherwise false.
Source§

impl<Config, Crypto, Rng> ExtKeyShareProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn key_share(&mut self, g: Group, d: &[u8]) -> bool

Source§

impl<Config, Crypto, Rng> ExtPskeProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn pske_mode(&mut self, _pske: PskeKind)

Signals the Pre-Shared Key Exchange Mode supported
Source§

impl<Config, Crypto, Rng> ExtRecSizeLimitProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn record_size_limit(&mut self, lim: u16)

Source§

impl<Config, Crypto, Rng> ExtSigAlgProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn signature_algorithm(&mut self, s_alg: SignatureAlgorithm) -> bool

Indicate support for the given Signature Algorithm.
Source§

impl<Config, Crypto, Rng> ExtSniProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn sni(&mut self, k: EntrySniKind, name: &[u8]) -> bool

Check whether any of the provided SNIs matches. When any of the entries matches, result will be true and otherwise false.
Source§

impl<Config, Crypto, Rng> ExtVersionProcessor for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn supported_version(&mut self, s_ver: Version) -> bool

Source§

impl<Config, Crypto, Rng> ServerCertificateVerifyBuilder for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn signature_algorithm(&self) -> [u8; 2]

Provide the signature algorithm used
Source§

fn sign_cert_verify(&self) -> &[u8]

Sign the current handshake hash with the used signature algorithm and the server private key used to generate the public key within the server certificate.
Source§

impl<Config, Crypto, Rng> ServerCertificatesBuilder for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn server_certs_list(&self) -> &[u8]

Provide ordered list of certificates and their internal id
Source§

fn server_cert_data(&self, id: u8) -> &[u8]

Provide the ASN.1 DER encoded certificate by the given cert id
Source§

fn server_cert_extensions(&self, _id: u8) -> &[u8]

Provide any certificate extensions if any by the given cert id.
Source§

impl<Config, Crypto, Rng> ServerHandshakeFinishedBuilder for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn hash_finished(&self) -> &[u8]

Provide the hash
Source§

impl<Config, Crypto, Rng> ServerHelloBuilder for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Source§

fn legacy_version(&self) -> &[u8; 2]

This should return [3, 3] for TLS 1.3
Source§

fn server_random(&self) -> &[u8; 32]

Generate 32 bytes server random for the Hello
Source§

fn legacy_session_id(&self) -> &[u8]

In TLS 1.3 provide the ClientHello session id (if any) back
Source§

fn selected_cipher_suite(&self) -> &[u8; 2]

Server selected the cipher suite from client’s list.
Source§

fn selected_legacy_insecure_compression_method(&self) -> Option<u8>

Server selected compression list. This must be None for TLS 1.3.
Source§

fn extensions_list(&self) -> &[u16]

Extensions used list
Source§

fn extension_data(&self, ext: u16) -> &[u8]

Given extension relevant encoded data. See [ytls_extensions] to encode.
Source§

impl<Config, Crypto, Rng> EncryptedExtensionsBuilder for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: TlsServerCtxConfig, Crypto: CryptoConfig, Rng: CryptoRng,

Auto Trait Implementations§

§

impl<Config, Crypto, Rng> Freeze for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: Freeze, Crypto: Freeze, Rng: Freeze,

§

impl<Config, Crypto, Rng> RefUnwindSafe for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: RefUnwindSafe, Crypto: RefUnwindSafe, Rng: RefUnwindSafe,

§

impl<Config, Crypto, Rng> Send for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: Send, Crypto: Send, Rng: Send,

§

impl<Config, Crypto, Rng> Sync for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: Sync, Crypto: Sync, Rng: Sync,

§

impl<Config, Crypto, Rng> Unpin for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: Unpin, Crypto: Unpin, Rng: Unpin,

§

impl<Config, Crypto, Rng> UnwindSafe for ServerHandshakeCtx<Config, Crypto, Rng>
where Config: UnwindSafe, Crypto: UnwindSafe, Rng: UnwindSafe,

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.