Lines Matching refs:dgbl

459     RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));  in ossl_rand_ctx_new()  local
461 if (dgbl == NULL) in ossl_rand_ctx_new()
472 dgbl->lock = CRYPTO_THREAD_lock_new(); in ossl_rand_ctx_new()
473 if (dgbl->lock == NULL) in ossl_rand_ctx_new()
476 if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL)) in ossl_rand_ctx_new()
479 if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL)) in ossl_rand_ctx_new()
482 return dgbl; in ossl_rand_ctx_new()
485 CRYPTO_THREAD_cleanup_local(&dgbl->private); in ossl_rand_ctx_new()
487 CRYPTO_THREAD_lock_free(dgbl->lock); in ossl_rand_ctx_new()
488 OPENSSL_free(dgbl); in ossl_rand_ctx_new()
494 RAND_GLOBAL *dgbl = vdgbl; in ossl_rand_ctx_free() local
496 if (dgbl == NULL) in ossl_rand_ctx_free()
499 CRYPTO_THREAD_lock_free(dgbl->lock); in ossl_rand_ctx_free()
500 CRYPTO_THREAD_cleanup_local(&dgbl->private); in ossl_rand_ctx_free()
501 CRYPTO_THREAD_cleanup_local(&dgbl->public); in ossl_rand_ctx_free()
502 EVP_RAND_CTX_free(dgbl->primary); in ossl_rand_ctx_free()
503 EVP_RAND_CTX_free(dgbl->seed); in ossl_rand_ctx_free()
504 OPENSSL_free(dgbl->rng_name); in ossl_rand_ctx_free()
505 OPENSSL_free(dgbl->rng_cipher); in ossl_rand_ctx_free()
506 OPENSSL_free(dgbl->rng_digest); in ossl_rand_ctx_free()
507 OPENSSL_free(dgbl->rng_propq); in ossl_rand_ctx_free()
508 OPENSSL_free(dgbl->seed_name); in ossl_rand_ctx_free()
509 OPENSSL_free(dgbl->seed_propq); in ossl_rand_ctx_free()
511 OPENSSL_free(dgbl); in ossl_rand_ctx_free()
522 RAND_GLOBAL *dgbl = rand_get_global(ctx); in rand_delete_thread_state() local
525 if (dgbl == NULL) in rand_delete_thread_state()
528 rand = CRYPTO_THREAD_get_local(&dgbl->public); in rand_delete_thread_state()
529 CRYPTO_THREAD_set_local(&dgbl->public, NULL); in rand_delete_thread_state()
532 rand = CRYPTO_THREAD_get_local(&dgbl->private); in rand_delete_thread_state()
533 CRYPTO_THREAD_set_local(&dgbl->private, NULL); in rand_delete_thread_state()
545 RAND_GLOBAL *dgbl = rand_get_global(libctx); in rand_new_seed() local
550 if (dgbl == NULL) in rand_new_seed()
552 propq = dgbl->seed_propq; in rand_new_seed()
553 if (dgbl->seed_name != NULL) { in rand_new_seed()
554 name = dgbl->seed_name; in rand_new_seed()
641 RAND_GLOBAL *dgbl = rand_get_global(ctx); in ossl_rand_get0_seed_noncreating() local
644 if (dgbl == NULL) in ossl_rand_get0_seed_noncreating()
647 if (!CRYPTO_THREAD_read_lock(dgbl->lock)) in ossl_rand_get0_seed_noncreating()
649 ret = dgbl->seed; in ossl_rand_get0_seed_noncreating()
650 CRYPTO_THREAD_unlock(dgbl->lock); in ossl_rand_get0_seed_noncreating()
660 RAND_GLOBAL *dgbl = rand_get_global(libctx); in rand_new_drbg() local
667 if (dgbl == NULL) in rand_new_drbg()
669 name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG"; in rand_new_drbg()
670 rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq); in rand_new_drbg()
684 cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR"; in rand_new_drbg()
688 if (dgbl->rng_digest != NULL in rand_new_drbg()
691 dgbl->rng_digest, 0); in rand_new_drbg()
692 if (dgbl->rng_propq != NULL) in rand_new_drbg()
694 dgbl->rng_propq, 0); in rand_new_drbg()
746 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_get0_primary() local
749 if (dgbl == NULL) in RAND_get0_primary()
752 if (!CRYPTO_THREAD_read_lock(dgbl->lock)) in RAND_get0_primary()
755 ret = dgbl->primary; in RAND_get0_primary()
756 CRYPTO_THREAD_unlock(dgbl->lock); in RAND_get0_primary()
761 if (!CRYPTO_THREAD_write_lock(dgbl->lock)) in RAND_get0_primary()
764 ret = dgbl->primary; in RAND_get0_primary()
766 CRYPTO_THREAD_unlock(dgbl->lock); in RAND_get0_primary()
772 if (dgbl->seed == NULL) { in RAND_get0_primary()
774 dgbl->seed = rand_new_seed(ctx); in RAND_get0_primary()
781 ret = rand_new_crngt(ctx, dgbl->seed); in RAND_get0_primary()
783 ret = rand_new_drbg(ctx, dgbl->seed, PRIMARY_RESEED_INTERVAL, in RAND_get0_primary()
791 dgbl->primary = ret; in RAND_get0_primary()
795 ret = dgbl->primary = NULL; in RAND_get0_primary()
797 CRYPTO_THREAD_unlock(dgbl->lock); in RAND_get0_primary()
808 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_get0_public() local
811 if (dgbl == NULL) in RAND_get0_public()
814 rand = CRYPTO_THREAD_get_local(&dgbl->public); in RAND_get0_public()
825 if (CRYPTO_THREAD_get_local(&dgbl->private) == NULL in RAND_get0_public()
830 CRYPTO_THREAD_set_local(&dgbl->public, rand); in RAND_get0_public()
841 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_get0_private() local
844 if (dgbl == NULL) in RAND_get0_private()
847 rand = CRYPTO_THREAD_get_local(&dgbl->private); in RAND_get0_private()
858 if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL in RAND_get0_private()
863 CRYPTO_THREAD_set_local(&dgbl->private, rand); in RAND_get0_private()
871 RAND_GLOBAL *dgbl = rand_get_global(ctx); in ossl_rand_get0_private_noncreating() local
873 if (dgbl == NULL) in ossl_rand_get0_private_noncreating()
876 return CRYPTO_THREAD_get_local(&dgbl->private); in ossl_rand_get0_private_noncreating()
882 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_set0_public() local
886 if (dgbl == NULL) in RAND_set0_public()
888 old = CRYPTO_THREAD_get_local(&dgbl->public); in RAND_set0_public()
889 if ((r = CRYPTO_THREAD_set_local(&dgbl->public, rand)) > 0) in RAND_set0_public()
896 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_set0_private() local
900 if (dgbl == NULL) in RAND_set0_private()
902 old = CRYPTO_THREAD_get_local(&dgbl->private); in RAND_set0_private()
903 if ((r = CRYPTO_THREAD_set_local(&dgbl->private, rand)) > 0) in RAND_set0_private()
930 RAND_GLOBAL *dgbl = rand_get_global(NCONF_get0_libctx((CONF *)cnf)); in random_conf_init() local
943 if (dgbl == NULL) in random_conf_init()
949 if (!random_set_string(&dgbl->rng_name, cval->value)) in random_conf_init()
952 if (!random_set_string(&dgbl->rng_cipher, cval->value)) in random_conf_init()
955 if (!random_set_string(&dgbl->rng_digest, cval->value)) in random_conf_init()
958 if (!random_set_string(&dgbl->rng_propq, cval->value)) in random_conf_init()
961 if (!random_set_string(&dgbl->seed_name, cval->value)) in random_conf_init()
964 if (!random_set_string(&dgbl->seed_propq, cval->value)) in random_conf_init()
991 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_set_DRBG_type() local
993 if (dgbl == NULL) in RAND_set_DRBG_type()
995 if (dgbl->primary != NULL) { in RAND_set_DRBG_type()
999 return random_set_string(&dgbl->rng_name, drbg) in RAND_set_DRBG_type()
1000 && random_set_string(&dgbl->rng_propq, propq) in RAND_set_DRBG_type()
1001 && random_set_string(&dgbl->rng_cipher, cipher) in RAND_set_DRBG_type()
1002 && random_set_string(&dgbl->rng_digest, digest); in RAND_set_DRBG_type()
1008 RAND_GLOBAL *dgbl = rand_get_global(ctx); in RAND_set_seed_source_type() local
1010 if (dgbl == NULL) in RAND_set_seed_source_type()
1012 if (dgbl->seed != NULL) { in RAND_set_seed_source_type()
1016 return random_set_string(&dgbl->seed_name, seed) in RAND_set_seed_source_type()
1017 && random_set_string(&dgbl->seed_propq, propq); in RAND_set_seed_source_type()