Skip to main content

mbedtls_ssl_ticket_setup

Function mbedtls_ssl_ticket_setup 

Source
pub unsafe extern "C" fn mbedtls_ssl_ticket_setup(
    ctx: *mut mbedtls_ssl_ticket_context,
    f_rng: mbedtls_f_rng_t,
    p_rng: *mut c_void,
    cipher: mbedtls_cipher_type_t,
    lifetime: u32,
) -> c_int
Expand description

\brief Prepare context to be actually used

\param ctx Context to be set up \param f_rng RNG callback function (mandatory) \param p_rng RNG callback context. Note that the RNG callback must remain valid until the ticket context is freed. \param cipher AEAD cipher to use for ticket protection. Recommended value: MBEDTLS_CIPHER_AES_256_GCM. \param lifetime Tickets lifetime in seconds Recommended value: 86400 (one day).

\note It is highly recommended to select a cipher that is at least as strong as the strongest ciphersuite supported. Usually that means a 256-bit key.

\note It is recommended to pick a reasonable lifetime so as not to negate the benefits of forward secrecy.

\note The TLS 1.3 specification states that ticket lifetime must be smaller than seven days. If ticket lifetime has been set to a value greater than seven days in this module then if the TLS 1.3 is configured to send tickets after the handshake it will fail the connection when trying to send the first ticket.

\return 0 if successful, or a specific MBEDTLS_ERR_XXX error code