Home
last modified time | relevance | path

Searched refs:mutex (Results 1 – 23 of 23) sorted by relevance

/openthread-latest/third_party/mbedtls/repo/tests/src/
Dthreading_helpers.c173 static void mbedtls_test_mutex_usage_error(mbedtls_threading_mutex_t *mutex, in mbedtls_test_mutex_usage_error() argument
176 (void) mutex; in mbedtls_test_mutex_usage_error()
186 static int mbedtls_test_mutex_can_test(mbedtls_threading_mutex_t *mutex) in mbedtls_test_mutex_can_test() argument
194 if (mutex == mbedtls_test_get_info_mutex()) { in mbedtls_test_mutex_can_test()
201 static void mbedtls_test_wrap_mutex_init(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_init() argument
203 mutex_functions.init(mutex); in mbedtls_test_wrap_mutex_init()
205 if (mbedtls_test_mutex_can_test(mutex)) { in mbedtls_test_wrap_mutex_init()
207 mutex->state = MUTEX_IDLE; in mbedtls_test_wrap_mutex_init()
215 static void mbedtls_test_wrap_mutex_free(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_free() argument
217 if (mbedtls_test_mutex_can_test(mutex)) { in mbedtls_test_wrap_mutex_free()
[all …]
/openthread-latest/third_party/mbedtls/repo/library/
Dthreading.c53 static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_init_pthread() argument
55 if (mutex == NULL) { in threading_mutex_init_pthread()
65 (void) pthread_mutex_init(&mutex->mutex, NULL); in threading_mutex_init_pthread()
68 static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_free_pthread() argument
70 if (mutex == NULL) { in threading_mutex_free_pthread()
74 (void) pthread_mutex_destroy(&mutex->mutex); in threading_mutex_free_pthread()
77 static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_lock_pthread() argument
79 if (mutex == NULL) { in threading_mutex_lock_pthread()
83 if (pthread_mutex_lock(&mutex->mutex) != 0) { in threading_mutex_lock_pthread()
90 static int threading_mutex_unlock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_unlock_pthread() argument
[all …]
Dssl_cache.c32 mbedtls_mutex_init(&cache->mutex); in mbedtls_ssl_cache_init()
84 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_get()
105 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_get()
259 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_set()
308 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_set()
331 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_remove()
362 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_remove()
405 mbedtls_mutex_free(&cache->mutex); in mbedtls_ssl_cache_free()
Dentropy.c33 mbedtls_mutex_init(&ctx->mutex); in mbedtls_entropy_init()
71 mbedtls_mutex_free(&ctx->mutex); in mbedtls_entropy_free()
89 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_add_source()
109 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_add_source()
175 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_update_manual()
183 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_update_manual()
250 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_gather()
258 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_gather()
290 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_func()
370 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_func()
Dssl_cookie.c75 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ssl_cookie_init()
93 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ssl_cookie_free()
245 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_cookie_write()
254 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_cookie_write()
328 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_cookie_check()
340 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_cookie_check()
Dssl_ticket.c41 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ssl_ticket_init()
330 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_ticket_write()
389 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_ticket_write()
445 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_ticket_parse()
524 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_ticket_parse()
546 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ssl_ticket_free()
Dmemory_buffer_alloc.c63 mbedtls_threading_mutex_t mutex; member
540 if (mbedtls_mutex_lock(&heap.mutex) != 0) { in buffer_alloc_calloc_mutexed()
544 if (mbedtls_mutex_unlock(&heap.mutex)) { in buffer_alloc_calloc_mutexed()
554 if (mbedtls_mutex_lock(&heap.mutex)) { in buffer_alloc_free_mutexed()
558 (void) mbedtls_mutex_unlock(&heap.mutex); in buffer_alloc_free_mutexed()
567 mbedtls_mutex_init(&heap.mutex); in mbedtls_memory_buffer_alloc_init()
599 mbedtls_mutex_free(&heap.mutex); in mbedtls_memory_buffer_alloc_free()
Dhmac_drbg.c108 mbedtls_mutex_init(&ctx->mutex); in mbedtls_hmac_drbg_seed_buf()
238 mbedtls_mutex_init(&ctx->mutex); in mbedtls_hmac_drbg_seed()
388 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_hmac_drbg_random()
396 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_hmac_drbg_random()
417 mbedtls_mutex_free(&ctx->mutex); in mbedtls_hmac_drbg_free()
Dctr_drbg.c102 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ctr_drbg_free()
549 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ctr_drbg_seed()
703 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ctr_drbg_random()
711 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ctr_drbg_random()
Drsa.c963 mbedtls_mutex_init(&ctx->mutex); in mbedtls_rsa_init()
1249 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_rsa_public()
1267 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_rsa_public()
1450 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_rsa_private()
1575 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_rsa_private()
2838 mbedtls_mutex_free(&ctx->mutex); in mbedtls_rsa_free()
/openthread-latest/third_party/mbedtls/repo/programs/test/
Dmetatest.c261 mbedtls_threading_mutex_t mutex; in mutex_lock_not_initialized() local
262 memset(&mutex, 0, sizeof(mutex)); in mutex_lock_not_initialized()
267 TEST_ASSERT(mbedtls_mutex_lock(&mutex) == 0); in mutex_lock_not_initialized()
277 mbedtls_threading_mutex_t mutex; in mutex_unlock_not_initialized() local
278 memset(&mutex, 0, sizeof(mutex)); in mutex_unlock_not_initialized()
283 TEST_ASSERT(mbedtls_mutex_unlock(&mutex) == 0); in mutex_unlock_not_initialized()
293 mbedtls_threading_mutex_t mutex; in mutex_free_not_initialized() local
294 memset(&mutex, 0, sizeof(mutex)); in mutex_free_not_initialized()
299 mbedtls_mutex_free(&mutex); in mutex_free_not_initialized()
307 mbedtls_threading_mutex_t mutex; in mutex_double_init() local
[all …]
/openthread-latest/third_party/mbedtls/repo/include/mbedtls/
Dthreading.h30 pthread_mutex_t MBEDTLS_PRIVATE(mutex);
81 extern void (*mbedtls_mutex_init)(mbedtls_threading_mutex_t *mutex);
82 extern void (*mbedtls_mutex_free)(mbedtls_threading_mutex_t *mutex);
83 extern int (*mbedtls_mutex_lock)(mbedtls_threading_mutex_t *mutex);
84 extern int (*mbedtls_mutex_unlock)(mbedtls_threading_mutex_t *mutex);
Dssl_cookie.h59 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
Dssl_cache.h72 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
Dssl_ticket.h82 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
Dhmac_drbg.h100 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
Dentropy.h113 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
Dctr_drbg.h214 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
Drsa.h120 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< Thread-safety mutex. */
/openthread-latest/third_party/mbedtls/repo/docs/architecture/psa-thread-safety/
Dpsa-thread-safety.md11 …- Key slots are protected by a global mutex, as described in [Key store consistency and abstractio…
78 …SA functions from a single thread, or which protect all PSA calls using a mutex, are not affected …
123mutex operation fails, which only happens if the mutex implementation fails, the error code `PSA_E…
139 We have added a mutex `mbedtls_threading_psa_globaldata_mutex` defined in `include/mbedtls/threadin…
143 …ldata_mutex`. The RNG fields within this struct are not protected by this mutex, and are not alway…
144 …escribed in [Key slots](#key-slots), `key_slots_initialized` is protected by the global data mutex.
148 …a thread attempts to lock a mutex while already holding it. Functions which need to be called whil…
150 …ticular, they must not start expensive operations (eg. doing cryptography) while holding the mutex.
184 The key store is protected by a single global mutex `mbedtls_threading_key_slot_mutex`.
186 …hile the mutex is held; there is a convenience function `psa_unregister_read_under_mutex` which wr…
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/suites/
Dtest_suite_psa_crypto_init.function74 mbedtls_mutex_init(&ctx->mutex);
Dtest_suite_psa_crypto.function1380 * locks the mutex to reserve a new slot, it will return
1385 * unlocks the mutex, then relocks it to finalize key creation.
/openthread-latest/third_party/mbedtls/repo/
DChangeLog2002 is enabled, on platforms where initializing a mutex allocates resources.
2008 enabled on platforms where freeing a mutex twice is not safe.
2011 a mutex allocates resources.
4337 result trying to unlock an unlocked mutex on invalid input (found by