30 #if !defined(POLARSSL_CONFIG_FILE)
33 #include POLARSSL_CONFIG_FILE
36 #if defined(POLARSSL_SSL_CACHE_C)
40 #if defined(POLARSSL_PLATFORM_C)
43 #define polarssl_malloc malloc
44 #define polarssl_free free
56 #if defined(POLARSSL_THREADING_C)
64 #if defined(POLARSSL_HAVE_TIME)
65 time_t t = time( NULL );
70 #if defined(POLARSSL_THREADING_C)
83 #if defined(POLARSSL_HAVE_TIME)
102 #if defined(POLARSSL_X509_CRT_PARSE_C)
134 #if defined(POLARSSL_THREADING_C)
145 #if defined(POLARSSL_HAVE_TIME)
146 time_t t = time( NULL ), oldest = 0;
153 #if defined(POLARSSL_THREADING_C)
165 #if defined(POLARSSL_HAVE_TIME)
177 #if defined(POLARSSL_HAVE_TIME)
178 if( oldest == 0 || cur->
timestamp < oldest )
191 #if defined(POLARSSL_HAVE_TIME)
212 if( cache->
chain == NULL )
245 #if defined(POLARSSL_HAVE_TIME)
252 #if defined(POLARSSL_X509_CRT_PARSE_C)
286 #if defined(POLARSSL_THREADING_C)
294 #if defined(POLARSSL_HAVE_TIME)
297 if( timeout < 0 ) timeout = 0;
305 if( max < 0 ) max = 0;
323 #if defined(POLARSSL_X509_CRT_PARSE_C)
331 #if defined(POLARSSL_THREADING_C)
int(* polarssl_mutex_lock)(threading_mutex_t *mutex)
void ssl_cache_init(ssl_cache_context *cache)
Initialize an SSL cache context.
x509_buf raw
The raw certificate data (DER).
#define SSL_CACHE_DEFAULT_TIMEOUT
SSL session cache implementation.
void ssl_session_free(ssl_session *session)
Free referenced items in an SSL session including the peer certificate and clear memory.
int x509_crt_parse(x509_crt *chain, const unsigned char *buf, size_t buflen)
Parse one or more certificates and add them to the chained list.
Configuration options (set of defines)
int ssl_cache_get(void *data, ssl_session *session)
Cache get callback implementation (Thread-safe if POLARSSL_THREADING_C is enabled) ...
void ssl_cache_free(ssl_cache_context *cache)
Free referenced items in a cache context and clear memory.
This structure is used for storing cache entries.
Container for an X.509 certificate.
void x509_crt_init(x509_crt *crt)
Initialize a certificate (chain)
unsigned char * p
ASN1 data, e.g.
void ssl_cache_set_timeout(ssl_cache_context *cache, int timeout)
Set the cache timeout (Default: SSL_CACHE_DEFAULT_TIMEOUT (1 day))
int(* polarssl_mutex_free)(threading_mutex_t *mutex)
Type-length-value structure that allows for ASN1 using DER.
size_t len
ASN1 length, e.g.
#define SSL_CACHE_DEFAULT_MAX_ENTRIES
void ssl_cache_set_max_entries(ssl_cache_context *cache, int max)
Set the cache timeout (Default: SSL_CACHE_DEFAULT_MAX_ENTRIES (50))
int(* polarssl_mutex_unlock)(threading_mutex_t *mutex)
int(* polarssl_mutex_init)(threading_mutex_t *mutex)
int ssl_cache_set(void *data, const ssl_session *session)
Cache set callback implementation (Thread-safe if POLARSSL_THREADING_C is enabled) ...