mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Add a field for application data to TLS structures
In structure types that are passed to user callbacks, add a field that the library won't ever care about. The application can use this field to either identify an instance of the structure with a handle, or store a pointer to extra data. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -1448,6 +1448,13 @@ struct mbedtls_ssl_config
|
||||
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C)
|
||||
unsigned int MBEDTLS_PRIVATE(dhm_min_bitlen); /*!< min. bit length of the DHM prime */
|
||||
#endif
|
||||
|
||||
/** User data pointer or handle.
|
||||
*
|
||||
* The library sets this to \p 0 when creating a context and does not
|
||||
* access it afterwards.
|
||||
*/
|
||||
uintptr_t user_data;
|
||||
};
|
||||
|
||||
struct mbedtls_ssl_context
|
||||
@ -1669,6 +1676,13 @@ struct mbedtls_ssl_context
|
||||
/** Callback to export key block and master secret */
|
||||
mbedtls_ssl_export_keys_t *MBEDTLS_PRIVATE(f_export_keys);
|
||||
void *MBEDTLS_PRIVATE(p_export_keys); /*!< context for key export callback */
|
||||
|
||||
/** User data pointer or handle.
|
||||
*
|
||||
* The library sets this to \p 0 when creating a context and does not
|
||||
* access it afterwards.
|
||||
*/
|
||||
uintptr_t user_data;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user