mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 02:23:32 -04:00
Define key_slot_mutex
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
parent
fb133513d6
commit
491f7e5ac3
@ -23,10 +23,27 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
|
#if defined(MBEDTLS_THREADING_C)
|
||||||
|
#include "mbedtls/threading.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
psa_key_slot_t key_slots[MBEDTLS_PSA_KEY_SLOT_COUNT];
|
psa_key_slot_t key_slots[MBEDTLS_PSA_KEY_SLOT_COUNT];
|
||||||
uint8_t key_slots_initialized;
|
uint8_t key_slots_initialized;
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_THREADING_C)
|
||||||
|
/*
|
||||||
|
* A mutex used to make the PSA subsystem thread safe.
|
||||||
|
*
|
||||||
|
* key_slot_mutex protects key_slots[i].registered_readers and
|
||||||
|
* key_slots[i].state for all valid i.
|
||||||
|
*
|
||||||
|
* This mutex must be held when any read from or write to a state or
|
||||||
|
* registered_readers field is performed, i.e. when calling functions:
|
||||||
|
* psa_key_slot_state_transition, psa_register_read, psa_unregister_read,
|
||||||
|
* psa_key_slot_has_readers and psa_wipe_key_slot. */
|
||||||
|
mbedtls_threading_mutex_t MBEDTLS_PRIVATE(key_slot_mutex);
|
||||||
|
#endif
|
||||||
} psa_global_data_t;
|
} psa_global_data_t;
|
||||||
|
|
||||||
static psa_global_data_t global_data;
|
static psa_global_data_t global_data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user