mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Make ssl ticket functions thread-safe
This commit is contained in:
parent
66b8e956bb
commit
0849a0a910
2 changed files with 68 additions and 21 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue