SSL session cache implementation.
More...
Go to the source code of this file.
|
void | mbedtls_ssl_cache_init (mbedtls_ssl_cache_context *cache) |
| Initialize an SSL cache context.
|
|
int | mbedtls_ssl_cache_get (void *data, unsigned char const *session_id, size_t session_id_len, mbedtls_ssl_session *session) |
| Cache get callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled)
|
|
int | mbedtls_ssl_cache_set (void *data, unsigned char const *session_id, size_t session_id_len, const mbedtls_ssl_session *session) |
| Cache set callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled)
|
|
int | mbedtls_ssl_cache_remove (void *data, unsigned char const *session_id, size_t session_id_len) |
| Remove the cache entry by the session ID (Thread-safe if MBEDTLS_THREADING_C is enabled)
|
|
void | mbedtls_ssl_cache_set_timeout (mbedtls_ssl_cache_context *cache, int timeout) |
| Set the cache timeout (Default: MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT (1 day))
|
|
static int | mbedtls_ssl_cache_get_timeout (mbedtls_ssl_cache_context *cache) |
| Get the cache timeout.
|
|
void | mbedtls_ssl_cache_set_max_entries (mbedtls_ssl_cache_context *cache, int max) |
| Set the maximum number of cache entries (Default: MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES (50))
|
|
void | mbedtls_ssl_cache_free (mbedtls_ssl_cache_context *cache) |
| Free referenced items in a cache context and clear memory.
|
|
SSL session cache implementation.
Definition in file ssl_cache.h.
◆ MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES
#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 |
Maximum entries in cache
Definition at line 35 of file ssl_cache.h.
◆ MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT
#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 |
◆ mbedtls_ssl_cache_context
typedef struct mbedtls_ssl_cache_context mbedtls_ssl_cache_context |
◆ mbedtls_ssl_cache_entry
typedef struct mbedtls_ssl_cache_entry mbedtls_ssl_cache_entry |
◆ mbedtls_ssl_cache_free()
Free referenced items in a cache context and clear memory.
- Parameters
-
◆ mbedtls_ssl_cache_get()
int mbedtls_ssl_cache_get |
( |
void * | data, |
|
|
unsigned char const * | session_id, |
|
|
size_t | session_id_len, |
|
|
mbedtls_ssl_session * | session ) |
Cache get callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled)
- Parameters
-
data | The SSL cache context to use. |
session_id | The pointer to the buffer holding the session ID for the session to load. |
session_id_len | The length of session_id in bytes. |
session | The address at which to store the session associated with session_id , if present. |
- Returns
0
on success.
-
MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND if there is no cache entry with specified session ID found, or any other negative error code for other failures.
◆ mbedtls_ssl_cache_get_timeout()
Get the cache timeout.
A timeout of 0 indicates no timeout.
- Parameters
-
- Returns
- cache entry timeout in seconds
Definition at line 161 of file ssl_cache.h.
◆ mbedtls_ssl_cache_init()
Initialize an SSL cache context.
- Parameters
-
◆ mbedtls_ssl_cache_remove()
int mbedtls_ssl_cache_remove |
( |
void * | data, |
|
|
unsigned char const * | session_id, |
|
|
size_t | session_id_len ) |
Remove the cache entry by the session ID (Thread-safe if MBEDTLS_THREADING_C is enabled)
- Parameters
-
data | The SSL cache context to use. |
session_id | The pointer to the buffer holding the session ID associated to session. |
session_id_len | The length of session_id in bytes. |
- Returns
0
on success. This indicates the cache entry for the session with provided ID is removed or does not exist.
-
A negative error code on failure.
◆ mbedtls_ssl_cache_set()
int mbedtls_ssl_cache_set |
( |
void * | data, |
|
|
unsigned char const * | session_id, |
|
|
size_t | session_id_len, |
|
|
const mbedtls_ssl_session * | session ) |
Cache set callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled)
- Parameters
-
data | The SSL cache context to use. |
session_id | The pointer to the buffer holding the session ID associated to session . |
session_id_len | The length of session_id in bytes. |
session | The session to store. |
- Returns
0
on success.
-
A negative error code on failure.
◆ mbedtls_ssl_cache_set_max_entries()
Set the maximum number of cache entries (Default: MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES (50))
- Parameters
-
cache | SSL cache context |
max | cache entry maximum |
◆ mbedtls_ssl_cache_set_timeout()
Set the cache timeout (Default: MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT (1 day))
A timeout of 0 indicates no timeout.
- Parameters
-
cache | SSL cache context |
timeout | cache entry timeout in seconds |