PolarSSL v1.2.9
ssl_cache.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_SSL_CACHE_H
28 #define POLARSSL_SSL_CACHE_H
29 
30 #include "ssl.h"
31 
32 #if !defined(POLARSSL_CONFIG_OPTIONS)
33 #define SSL_CACHE_DEFAULT_TIMEOUT 86400
34 #define SSL_CACHE_DEFAULT_MAX_ENTRIES 50
35 #endif /* !POLARSSL_CONFIG_OPTIONS */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
43 
48 {
49  time_t timestamp;
53 };
54 
59 {
61  int timeout;
63 };
64 
70 void ssl_cache_init( ssl_cache_context *cache );
71 
78 int ssl_cache_get( void *data, ssl_session *session );
79 
86 int ssl_cache_set( void *data, const ssl_session *session );
87 
97 void ssl_cache_set_timeout( ssl_cache_context *cache, int timeout );
98 
106 void ssl_cache_set_max_entries( ssl_cache_context *cache, int max );
107 
113 void ssl_cache_free( ssl_cache_context *cache );
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif /* ssl_cache.h */
void ssl_cache_init(ssl_cache_context *cache)
Initialize an SSL cache context.
ssl_cache_entry * next
Definition: ssl_cache.h:52
ssl_cache_entry * chain
Definition: ssl_cache.h:60
int ssl_cache_get(void *data, ssl_session *session)
Cache get callback implementation.
x509_buf peer_cert
Definition: ssl_cache.h:51
void ssl_cache_free(ssl_cache_context *cache)
Free referenced items in a cache context and clear memory.
Cache context.
Definition: ssl_cache.h:58
This structure is used for storing cache entries.
Definition: ssl_cache.h:47
ssl_session session
Definition: ssl_cache.h:50
void ssl_cache_set_timeout(ssl_cache_context *cache, int timeout)
Set the cache timeout (Default: SSL_CACHE_DEFAULT_TIMEOUT (1 day))
Type-length-value structure that allows for ASN1 using DER.
Definition: asn1.h:108
void ssl_cache_set_max_entries(ssl_cache_context *cache, int max)
Set the cache timeout (Default: SSL_CACHE_DEFAULT_MAX_ENTRIES (50))
time_t timestamp
Definition: ssl_cache.h:49
SSL/TLS functions.
int ssl_cache_set(void *data, const ssl_session *session)
Cache set callback implementation.