[][src]Function tls_parser::tls_state_transition

pub fn tls_state_transition(
    state: TlsState,
    msg: &TlsMessage<'_>,
    to_server: bool
) -> Result<TlsState, StateChangeError>

Update the TLS state machine, doing one transition

Given the previous state and the parsed message, return the new state or a state machine error.

This state machine only implements the TLS handshake.

Some transitions only check the new message type, while some others must match the content (for example, to check if the client asked to resume a session).

If the previous state is Invalid, the state machine will not return an error, but keep the same Invalid state. This is used to raise error only once if the state machine keeps being updated by new messages.