BearSSL
|
Class type for a session parameter cache. More...
Data Fields | |
size_t | context_size |
Context size (in bytes). More... | |
void(* | save )(const br_ssl_session_cache_class **ctx, br_ssl_server_context *server_ctx, const br_ssl_session_parameters *params) |
Record a session. More... | |
int(* | load )(const br_ssl_session_cache_class **ctx, br_ssl_server_context *server_ctx, br_ssl_session_parameters *params) |
Lookup a session in the cache. More... | |
Class type for a session parameter cache.
Session parameters are saved in the cache with save()
, and retrieved with load()
. The cache implementation can apply any storage and eviction strategy that it sees fit. The SSL server context that performs the request is provided, so that its functionalities may be used by the implementation (e.g. hash functions or random number generation).
size_t br_ssl_session_cache_class::context_size |
Context size (in bytes).
int(* br_ssl_session_cache_class::load) (const br_ssl_session_cache_class **ctx, br_ssl_server_context *server_ctx, br_ssl_session_parameters *params) |
Lookup a session in the cache.
The session ID to lookup is in params
and always has length exactly 32 bytes. If the session parameters are found in the cache, then the parameters shall be copied into the params
structure. Returned value is 1 on successful lookup, 0 otherwise.
ctx | session cache context. |
server_ctx | SSL server context. |
params | destination for session parameters. |
void(* br_ssl_session_cache_class::save) (const br_ssl_session_cache_class **ctx, br_ssl_server_context *server_ctx, const br_ssl_session_parameters *params) |
Record a session.
This callback should record the provided session parameters. The params
structure is transient, so its contents shall be copied into the cache. The session ID has been randomly generated and always has length exactly 32 bytes.
ctx | session cache context. |
server_ctx | SSL server context. |
params | session parameters to save. |