1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Serializing a context does not save the user data

The user data is typically a pointer to a data structure or a handle which
may no longer be valid after the session is restored. If the user data needs
to be preserved, let the application do it. This way, it is a conscious
decision for the application to save/restore either the pointer/handle
itself or the object it refers to.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-01-27 23:25:51 +01:00
parent 80dae04f24
commit 49d7ddf7f3
2 changed files with 19 additions and 2 deletions

View File

@ -2105,6 +2105,8 @@ void perform_handshake( handshake_test_options* options )
mbedtls_mock_tcp_recv_msg,
NULL );
mbedtls_ssl_set_user_data_p( &server.ssl, &server );
#if defined(MBEDTLS_TIMING_C)
mbedtls_ssl_set_timer_cb( &server.ssl, &timer_server,
mbedtls_timing_set_delay,