Make ssl ticket functions thread-safe

This commit is contained in:
Manuel Pégourié-Gonnard 2015-05-20 11:34:54 +02:00
parent 66b8e956bb
commit 0849a0a910
2 changed files with 68 additions and 21 deletions

View file

@ -27,11 +27,14 @@
#include "ssl.h"
#include "aes.h"
#if defined(MBEDTLS_THREADING_C)
#include "threading.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Context for session ticket handling functions
*/
@ -47,6 +50,10 @@ typedef struct
/** Callback for getting (pseudo-)random numbers */
int (*f_rng)(void *, unsigned char *, size_t);
void *p_rng; /*!< context for the RNG function */
#if defined(MBEDTLS_THREADING_C)
mbedtls_threading_mutex_t mutex;
#endif
}
mbedtls_ssl_ticket_context;