mbed TLS v2.3.0
ssl_ticket.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_SSL_TICKET_H
26 #define MBEDTLS_SSL_TICKET_H
27 
28 /*
29  * This implementation of the session ticket callbacks includes key
30  * management, rotating the keys periodically in order to preserve forward
31  * secrecy, when MBEDTLS_HAVE_TIME is defined.
32  */
33 
34 #include "ssl.h"
35 #include "cipher.h"
36 
37 #if defined(MBEDTLS_THREADING_C)
38 #include "threading.h"
39 #endif
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 typedef struct
49 {
50  unsigned char name[4];
51  uint32_t generation_time;
53 }
55 
59 typedef struct
60 {
62  unsigned char active;
64  uint32_t ticket_lifetime;
67  int (*f_rng)(void *, unsigned char *, size_t);
68  void *p_rng;
70 #if defined(MBEDTLS_THREADING_C)
71  mbedtls_threading_mutex_t mutex;
72 #endif
73 }
75 
84 
108  int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
110  uint32_t lifetime );
111 
118 
125 
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* ssl_ticket.h */
int mbedtls_ssl_ticket_parse_t(void *p_ticket, mbedtls_ssl_session *session, unsigned char *buf, size_t len)
Callback type: parse and load session ticket.
Definition: ssl.h:1241
int mbedtls_ssl_ticket_setup(mbedtls_ssl_ticket_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, mbedtls_cipher_type_t cipher, uint32_t lifetime)
Prepare context to be actually used.
Generic cipher context.
Definition: cipher.h:216
uint32_t generation_time
Definition: ssl_ticket.h:51
void mbedtls_ssl_ticket_init(mbedtls_ssl_ticket_context *ctx)
Initialize a ticket context.
mbedtls_cipher_type_t
Definition: cipher.h:82
mbedtls_cipher_type_t cipher
Threading abstraction layer.
mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse
Implementation of the ticket parse callback.
Definition: ssl_ticket.h:124
mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write
Implementation of the ticket write callback.
Definition: ssl_ticket.h:117
Generic cipher wrapper.
Information for session ticket protection.
Definition: ssl_ticket.h:48
SSL/TLS functions.
int mbedtls_ssl_ticket_write_t(void *p_ticket, const mbedtls_ssl_session *session, unsigned char *start, const unsigned char *end, size_t *tlen, uint32_t *lifetime)
Callback type: generate and write session ticket.
Definition: ssl.h:1182
mbedtls_cipher_context_t ctx
Definition: ssl_ticket.h:52
void mbedtls_ssl_ticket_free(mbedtls_ssl_ticket_context *ctx)
Free a context's content and zeroize it.
Context for session ticket handling functions.
Definition: ssl_ticket.h:59