Function esp_idf_hal::sys::mbedtls_ssl_session_load
source · pub unsafe extern "C" fn mbedtls_ssl_session_load(
session: *mut mbedtls_ssl_session,
buf: *const u8,
len: usize,
) -> i32
Expand description
\brief Load serialized session data into a session structure. On client, this can be used for loading saved sessions before resuming them with mbedtls_ssl_set_session(). On server, this can be used for alternative implementations of session cache or session tickets.
\warning If a peer certificate chain is associated with the session, the serialized state will only contain the peer’s end-entity certificate and the result of the chain verification (unless verification was disabled), but not the rest of the chain.
\see mbedtls_ssl_session_save() \see mbedtls_ssl_set_session()
\param session The session structure to be populated. It must have been initialised with mbedtls_ssl_session_init() but not populated yet. \param buf The buffer holding the serialized session data. It must be a readable buffer of at least \p len bytes. \param len The size of the serialized data in bytes.
\return \c 0 if successful. \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed. \return #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if input data is invalid. \return #MBEDTLS_ERR_SSL_VERSION_MISMATCH if the serialized data was generated in a different version or configuration of Mbed TLS. \return Another negative value for other kinds of errors (for example, unsupported features in the embedded certificate).