blob: b28ce1946ab09903fe8395470d46864872b6ec2b [file] [log] [blame] [view]
Hanno Becker90393032021-05-18 05:27:18 +01001Session Cache API Change
2-----------------------------------------------------------------
3
4This affects users who use `mbedtls_ssl_conf_session_cache()`
5to configure a custom session cache implementation different
6from the one Mbed TLS implements in `library/ssl_cache.c`.
7
8Those users will need to modify the API of their session cache
9implementation to that of a key-value store with keys being
10session IDs and values being instances of `mbedtls_ssl_session`:
11
12```
13typedef int mbedtls_ssl_cache_get_t( void *data,
14 unsigned char const *session_id,
15 size_t session_id_len,
16 mbedtls_ssl_session *session );
17typedef int mbedtls_ssl_cache_set_t( void *data,
18 unsigned char const *session_id,
19 size_t session_id_len,
20 const mbedtls_ssl_session *session );
21```
22
23Since the structure of `mbedtls_ssl_session` is no longer public from 3.0
24onwards, portable session cache implementations must not access fields of
25`mbedtls_ssl_session`. See the corresponding migration guide. Users that
26find themselves unable to migrate their session cache functionality without
27accessing fields of `mbedtls_ssl_session` should describe their usecase
28on the Mbed TLS mailing list.