mbed TLS v2.3.0
ssl_cache.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_SSL_CACHE_H
26 #define MBEDTLS_SSL_CACHE_H
27 
28 #include "ssl.h"
29 
30 #if defined(MBEDTLS_THREADING_C)
31 #include "threading.h"
32 #endif
33 
42 #if !defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT)
43 #define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400
44 #endif
45 
46 #if !defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES)
47 #define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50
48 #endif
49 
50 /* \} name SECTION: Module settings */
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
58 
63 {
64 #if defined(MBEDTLS_HAVE_TIME)
66 #endif
68 #if defined(MBEDTLS_X509_CRT_PARSE_C)
70 #endif
72 };
73 
78 {
80  int timeout;
82 #if defined(MBEDTLS_THREADING_C)
83  mbedtls_threading_mutex_t mutex;
84 #endif
85 };
86 
93 
101 int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session );
102 
110 int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session );
111 
112 #if defined(MBEDTLS_HAVE_TIME)
113 
122 void mbedtls_ssl_cache_set_timeout( mbedtls_ssl_cache_context *cache, int timeout );
123 #endif /* MBEDTLS_HAVE_TIME */
124 
133 
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif /* ssl_cache.h */
mbedtls_x509_buf peer_cert
Definition: ssl_cache.h:69
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))
mbedtls_ssl_cache_entry * chain
Definition: ssl_cache.h:79
Type-length-value structure that allows for ASN1 using DER.
Definition: asn1.h:120
Threading abstraction layer.
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_init(mbedtls_ssl_cache_context *cache)
Initialize an SSL cache context.
int mbedtls_ssl_cache_get(void *data, mbedtls_ssl_session *session)
Cache get callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled) ...
mbedtls_time_t timestamp
Definition: ssl_cache.h:65
int mbedtls_ssl_cache_set(void *data, const mbedtls_ssl_session *session)
Cache set callback implementation (Thread-safe if MBEDTLS_THREADING_C is enabled) ...
void mbedtls_ssl_cache_free(mbedtls_ssl_cache_context *cache)
Free referenced items in a cache context and clear memory.
This structure is used for storing cache entries.
Definition: ssl_cache.h:62
Cache context.
Definition: ssl_cache.h:77
time_t mbedtls_time_t
Definition: platform.h:256
SSL/TLS functions.
mbedtls_ssl_cache_entry * next
Definition: ssl_cache.h:71
mbedtls_ssl_session session
Definition: ssl_cache.h:67