pub struct NeedsInput { /* private fields */ }Expand description
More data needs to be processed to make progress.
Provide the data to Self::process().
This type dereferences to ConnectionOutputs. Individual outputs are None
until they are learned during the handshake.
Implementations§
Source§impl NeedsInput
impl NeedsInput
Sourcepub fn quic_transport_parameters(&self) -> Option<&[u8]>
pub fn quic_transport_parameters(&self) -> Option<&[u8]>
Return the TLS-encoded transport parameters received from the peer.
While the transport parameters are available before the handshake completes, they cannot be fully trusted until then. Reliance on them should be minimized. Any tampering with the parameters will cause the handshake to fail.
Sourcepub fn zero_rtt_keys(&self) -> Option<DirectionalKeys>
pub fn zero_rtt_keys(&self) -> Option<DirectionalKeys>
Compute the keys for decrypting 0-RTT packets, if available.
Sourcepub fn server_name(&self) -> Option<&DnsName<'_>>
pub fn server_name(&self) -> Option<&DnsName<'_>>
Retrieves the server name supplied by the client, if any.
Sourcepub fn process(
self,
input: &mut dyn TlsInputBuffer,
output: &mut Vec<QuicEvent>,
) -> Result<ServerHandshake, Error>
pub fn process( self, input: &mut dyn TlsInputBuffer, output: &mut Vec<QuicEvent>, ) -> Result<ServerHandshake, Error>
Progress the handshake by receiving further unencrypted TLS handshake data.
The input should be ordered QUIC CRYPTO stream data for one encryption level.
Handshake data obtained from separate encryption levels should be supplied in separate calls.
How much of the input buffer is consumed is recorded by a call to
TlsInputBuffer::discard(). Unconsumed data should be presented again on the next call.
An error from this function is fatal to the connection, as it consumes the NeedsInput
object.
On success, this returns:
- a
ServerHandshake::NeedsInputif more data is required. - a
ServerHandshake::Acceptedif a wholeClientHellohas been received, and a choice ofServerConfigis required to continue. - a
ServerHandshake::Completeif the handshake is complete.
output has any resulting handshake messages or key changes appended to it.
Methods from Deref<Target = ConnectionOutputs>§
Sourcepub fn peer_identity(&self) -> Option<&VerifiedIdentity<'static>>
pub fn peer_identity(&self) -> Option<&VerifiedIdentity<'static>>
Retrieves the certificate chain or the raw public key used by the peer to authenticate.
This is made available for both full and resumed handshakes.
For clients, this is the identity of the server. For servers, this is the identity of the client, if client authentication was completed.
The return value is None until this value is available.
Sourcepub fn alpn_protocol(&self) -> Option<&ApplicationProtocol<'static>>
pub fn alpn_protocol(&self) -> Option<&ApplicationProtocol<'static>>
Retrieves the protocol agreed with the peer via ALPN.
A return value of None after handshake completion
means no protocol was agreed (because no protocols
were offered or accepted by the peer).
Sourcepub fn negotiated_cipher_suite(&self) -> Option<SupportedCipherSuite>
pub fn negotiated_cipher_suite(&self) -> Option<SupportedCipherSuite>
Retrieves the cipher suite agreed with the peer.
This returns None until the cipher suite is agreed.
Sourcepub fn negotiated_key_exchange_group(
&self,
) -> Option<&'static dyn SupportedKxGroup>
pub fn negotiated_key_exchange_group( &self, ) -> Option<&'static dyn SupportedKxGroup>
Retrieves the key exchange group agreed with the peer.
This function may return None depending on the state of the connection,
the type of handshake, and the protocol version.
If CommonState::is_handshaking() is true this function will return None.
Similarly, if the ConnectionOutputs::handshake_kind() is HandshakeKind::Resumed
and the ConnectionOutputs::protocol_version() is TLS 1.2, then no key exchange will have
occurred and this function will return None.
Sourcepub fn protocol_version(&self) -> Option<ProtocolVersion>
pub fn protocol_version(&self) -> Option<ProtocolVersion>
Retrieves the protocol version agreed with the peer.
This returns None until the version is agreed.
Sourcepub fn extended_main_secret(&self) -> Option<bool>
pub fn extended_main_secret(&self) -> Option<bool>
Whether the Extended Main Secret extension was negotiated.
Returns:
Noneuntil the handshake reaches the point where this is known.Nonefor TLS 1.3, where the extension does not apply.Some(true)for TLS 1.2 if the extension was negotiated.Some(false)otherwise.
Sourcepub fn handshake_kind(&self) -> Option<HandshakeKind>
pub fn handshake_kind(&self) -> Option<HandshakeKind>
Which kind of handshake was performed.
This tells you whether the handshake was a resumption or not.
This will return None before it is known which sort of
handshake occurred.