Add accessor function from mbedtls_ssl_context to the configuration

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2022-01-13 01:05:10 +01:00
parent 69477b5706
commit 915896f03c
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,5 @@
Features
* The structures mbedtls_ssl_config and mbedtls_ssl_context have an
extra field user_data which is reserved for the application.
* Add an accessor function to get the configuration associated with
an SSL context.

View File

@ -1850,6 +1850,22 @@ void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf,
void (*f_dbg)(void *, int, const char *, int, const char *),
void *p_dbg );
/**
* \brief Return the SSL configuration structure associated
* with the given SSL context.
*
* \note The pointer returned by this function is guaranteed to
* remain valid until the context is freed.
*
* \param ssl The SSL context to query.
* \return Pointer to the SSL configuration associated with \p ssl.
*/
static inline const mbedtls_ssl_config *mbedtls_ssl_context_get_config(
const mbedtls_ssl_context *ssl )
{
return( ssl->MBEDTLS_PRIVATE( conf ) );
}
/**
* \brief Set the underlying BIO callbacks for write, read and
* read-with-timeout.