/mbedtls-3.5.0/tests/src/ |
D | threading_helpers.c | 99 static void mbedtls_test_mutex_usage_error(mbedtls_threading_mutex_t *mutex, in mbedtls_test_mutex_usage_error() argument 102 (void) mutex; in mbedtls_test_mutex_usage_error() 113 static void mbedtls_test_wrap_mutex_init(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_init() argument 115 mutex_functions.init(mutex); in mbedtls_test_wrap_mutex_init() 116 if (mutex->is_valid) { in mbedtls_test_wrap_mutex_init() 121 static void mbedtls_test_wrap_mutex_free(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_free() argument 123 switch (mutex->is_valid) { in mbedtls_test_wrap_mutex_free() 125 mbedtls_test_mutex_usage_error(mutex, "free without init or double free"); in mbedtls_test_wrap_mutex_free() 132 mbedtls_test_mutex_usage_error(mutex, "free without unlock"); in mbedtls_test_wrap_mutex_free() 135 mbedtls_test_mutex_usage_error(mutex, "corrupted state"); in mbedtls_test_wrap_mutex_free() [all …]
|
/mbedtls-3.5.0/library/ |
D | threading.c | 65 static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_init_pthread() argument 67 if (mutex == NULL) { in threading_mutex_init_pthread() 77 mutex->is_valid = pthread_mutex_init(&mutex->mutex, NULL) == 0; in threading_mutex_init_pthread() 80 static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_free_pthread() argument 82 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_free_pthread() 86 (void) pthread_mutex_destroy(&mutex->mutex); in threading_mutex_free_pthread() 87 mutex->is_valid = 0; in threading_mutex_free_pthread() 90 static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_lock_pthread() argument 92 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_lock_pthread() 96 if (pthread_mutex_lock(&mutex->mutex) != 0) { in threading_mutex_lock_pthread() [all …]
|
D | ssl_cache.c | 43 mbedtls_mutex_init(&cache->mutex); in mbedtls_ssl_cache_init() 95 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_get() 116 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_get() 270 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_set() 320 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_set() 344 if ((ret = mbedtls_mutex_lock(&cache->mutex)) != 0) { in mbedtls_ssl_cache_remove() 375 if (mbedtls_mutex_unlock(&cache->mutex) != 0) { in mbedtls_ssl_cache_remove() 418 mbedtls_mutex_free(&cache->mutex); in mbedtls_ssl_cache_free()
|
D | entropy.c | 48 mbedtls_mutex_init(&ctx->mutex); in mbedtls_entropy_init() 90 mbedtls_mutex_free(&ctx->mutex); in mbedtls_entropy_free() 112 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_add_source() 132 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_add_source() 210 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_update_manual() 218 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_update_manual() 285 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_gather() 293 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_gather() 325 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_entropy_func() 426 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_entropy_func()
|
D | ssl_cookie.c | 82 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ssl_cookie_init() 100 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ssl_cookie_free() 252 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_cookie_write() 261 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_cookie_write() 335 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_cookie_check() 347 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_cookie_check()
|
D | ssl_ticket.c | 47 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ssl_ticket_init() 329 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_ticket_write() 388 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_ticket_write() 444 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ssl_ticket_parse() 518 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ssl_ticket_parse() 540 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ssl_ticket_free()
|
D | memory_buffer_alloc.c | 75 mbedtls_threading_mutex_t mutex; member 552 if (mbedtls_mutex_lock(&heap.mutex) != 0) { in buffer_alloc_calloc_mutexed() 556 if (mbedtls_mutex_unlock(&heap.mutex)) { in buffer_alloc_calloc_mutexed() 566 if (mbedtls_mutex_lock(&heap.mutex)) { in buffer_alloc_free_mutexed() 570 (void) mbedtls_mutex_unlock(&heap.mutex); in buffer_alloc_free_mutexed() 579 mbedtls_mutex_init(&heap.mutex); in mbedtls_memory_buffer_alloc_init() 611 mbedtls_mutex_free(&heap.mutex); in mbedtls_memory_buffer_alloc_free()
|
D | hmac_drbg.c | 120 mbedtls_mutex_init(&ctx->mutex); in mbedtls_hmac_drbg_seed_buf() 250 mbedtls_mutex_init(&ctx->mutex); in mbedtls_hmac_drbg_seed() 400 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_hmac_drbg_random() 408 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_hmac_drbg_random() 429 mbedtls_mutex_free(&ctx->mutex); in mbedtls_hmac_drbg_free()
|
D | ctr_drbg.c | 68 mbedtls_mutex_free(&ctx->mutex); in mbedtls_ctr_drbg_free() 444 mbedtls_mutex_init(&ctx->mutex); in mbedtls_ctr_drbg_seed() 580 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ctr_drbg_random() 588 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_ctr_drbg_random()
|
D | rsa.c | 465 mbedtls_mutex_init(&ctx->mutex); in mbedtls_rsa_init() 739 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_rsa_public() 757 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_rsa_public() 910 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_rsa_private() 1042 if (mbedtls_mutex_unlock(&ctx->mutex) != 0) { in mbedtls_rsa_private() 2352 mbedtls_mutex_free(&ctx->mutex); in mbedtls_rsa_free()
|
/mbedtls-3.5.0/include/mbedtls/ |
D | threading.h | 42 pthread_mutex_t MBEDTLS_PRIVATE(mutex); 89 extern void (*mbedtls_mutex_init)(mbedtls_threading_mutex_t *mutex); 90 extern void (*mbedtls_mutex_free)(mbedtls_threading_mutex_t *mutex); 91 extern int (*mbedtls_mutex_lock)(mbedtls_threading_mutex_t *mutex); 92 extern int (*mbedtls_mutex_unlock)(mbedtls_threading_mutex_t *mutex);
|
D | ssl_cookie.h | 71 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
|
D | ssl_cache.h | 84 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
|
D | ssl_ticket.h | 90 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
|
D | hmac_drbg.h | 112 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
|
D | entropy.h | 131 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
|
D | ctr_drbg.h | 210 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
|
D | rsa.h | 126 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< Thread-safety mutex. */
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_psa_crypto_init.function | 73 mbedtls_mutex_init(&ctx->mutex);
|
/mbedtls-3.5.0/ |
D | ChangeLog | 1421 is enabled, on platforms where initializing a mutex allocates resources. 1427 enabled on platforms where freeing a mutex twice is not safe. 1430 a mutex allocates resources. 3756 result trying to unlock an unlocked mutex on invalid input (found by
|