Lines Matching refs:NULL

35     EVP_MD *md = EVP_MD_fetch(libctx, t->algorithm, NULL);  in self_test_digest()
39 if (ctx == NULL in self_test_digest()
40 || md == NULL in self_test_digest()
41 || !EVP_DigestInit_ex(ctx, md, NULL) in self_test_digest()
67 unsigned char *in_tag = NULL; in cipher_init()
72 if (t->tag == NULL) { in cipher_init()
74 return EVP_CipherInit_ex(ctx, cipher, NULL, t->key, t->iv, enc) in cipher_init()
82 return EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc) in cipher_init()
83 && (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, t->iv_len, NULL) > 0) in cipher_init()
84 && (in_tag == NULL in cipher_init()
87 && EVP_CipherInit_ex(ctx, NULL, NULL, t->key, t->iv, enc) in cipher_init()
89 && EVP_CipherUpdate(ctx, NULL, &tmp, t->aad, t->aad_len); in cipher_init()
97 EVP_CIPHER_CTX *ctx = NULL; in self_test_cipher()
98 EVP_CIPHER *cipher = NULL; in self_test_cipher()
105 if (ctx == NULL) in self_test_cipher()
107 cipher = EVP_CIPHER_fetch(libctx, t->base.algorithm, NULL); in self_test_cipher()
108 if (cipher == NULL) in self_test_cipher()
125 if (t->tag != NULL) { in self_test_cipher()
163 if (params == NULL) in add_params()
165 for (p = params; p->data != NULL; ++p) { in add_params()
170 if (bn == NULL in add_params()
171 || (BN_bin2bn(p->data, p->data_len, bn) == NULL) in add_params()
207 EVP_KDF *kdf = NULL; in self_test_kdf()
208 EVP_KDF_CTX *ctx = NULL; in self_test_kdf()
209 BN_CTX *bnctx = NULL; in self_test_kdf()
210 OSSL_PARAM *params = NULL; in self_test_kdf()
211 OSSL_PARAM_BLD *bld = NULL; in self_test_kdf()
216 if (bld == NULL) in self_test_kdf()
220 if (kdf == NULL) in self_test_kdf()
224 if (ctx == NULL) in self_test_kdf()
228 if (bnctx == NULL) in self_test_kdf()
233 if (params == NULL) in self_test_kdf()
263 EVP_RAND_CTX *test = NULL, *drbg = NULL; in self_test_drbg()
272 rand = EVP_RAND_fetch(libctx, "TEST-RAND", NULL); in self_test_drbg()
273 if (rand == NULL) in self_test_drbg()
276 test = EVP_RAND_CTX_new(rand, NULL); in self_test_drbg()
278 if (test == NULL) in self_test_drbg()
286 rand = EVP_RAND_fetch(libctx, t->algorithm, NULL); in self_test_drbg()
287 if (rand == NULL) in self_test_drbg()
292 if (drbg == NULL) in self_test_drbg()
312 if (!EVP_RAND_instantiate(test, strength, 0, NULL, 0, drbg_params)) in self_test_drbg()
315 NULL)) in self_test_drbg()
373 EVP_PKEY_CTX *kactx = NULL, *dctx = NULL; in self_test_ka()
374 EVP_PKEY *pkey = NULL, *peerkey = NULL; in self_test_ka()
375 OSSL_PARAM *params = NULL; in self_test_ka()
376 OSSL_PARAM *params_peer = NULL; in self_test_ka()
379 OSSL_PARAM_BLD *bld = NULL; in self_test_ka()
380 BN_CTX *bnctx = NULL; in self_test_ka()
388 if (bnctx == NULL) in self_test_ka()
392 if (bld == NULL) in self_test_ka()
405 if (params == NULL || params_peer == NULL) in self_test_ka()
410 if (kactx == NULL) in self_test_ka()
420 dctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, NULL); in self_test_ka()
421 if (dctx == NULL) in self_test_ka()
453 OSSL_PARAM *paramskey = NULL, *paramsinit = NULL; in self_test_digest_sign()
454 OSSL_PARAM_BLD *bldkey = NULL, *bldinit = NULL; in self_test_digest_sign()
455 EVP_MD_CTX *mctx = NULL; in self_test_digest_sign()
456 EVP_PKEY_CTX *fromctx = NULL; in self_test_digest_sign()
457 EVP_PKEY *pkey = NULL; in self_test_digest_sign()
459 BN_CTX *bnctx = NULL; in self_test_digest_sign()
464 if (t->sig_expected == NULL) in self_test_digest_sign()
469 if (t->entropy != NULL) { in self_test_digest_sign()
476 if (bnctx == NULL) in self_test_digest_sign()
481 if (bldkey == NULL || bldinit == NULL) in self_test_digest_sign()
492 if (fromctx == NULL in self_test_digest_sign()
493 || paramskey == NULL in self_test_digest_sign()
494 || paramsinit == NULL) in self_test_digest_sign()
501 if (mctx == NULL) in self_test_digest_sign()
510 if (EVP_DigestSignInit_ex(mctx, NULL, t->mdalgorithm, libctx, NULL, in self_test_digest_sign()
523 if (t->sig_expected != NULL in self_test_digest_sign()
530 if (EVP_DigestVerifyInit_ex(mctx, NULL, t->mdalgorithm, libctx, NULL, in self_test_digest_sign()
553 if (t->entropy != NULL) { in self_test_digest_sign()
571 OSSL_PARAM *keyparams = NULL, *initparams = NULL; in self_test_asym_cipher()
572 OSSL_PARAM_BLD *keybld = NULL, *initbld = NULL; in self_test_asym_cipher()
573 EVP_PKEY_CTX *encctx = NULL, *keyctx = NULL; in self_test_asym_cipher()
574 EVP_PKEY *key = NULL; in self_test_asym_cipher()
575 BN_CTX *bnctx = NULL; in self_test_asym_cipher()
582 if (bnctx == NULL) in self_test_asym_cipher()
587 if (keybld == NULL in self_test_asym_cipher()
591 keyctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, NULL); in self_test_asym_cipher()
592 if (keyctx == NULL || keyparams == NULL) in self_test_asym_cipher()
599 encctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL); in self_test_asym_cipher()
600 if (encctx == NULL in self_test_asym_cipher()
606 if (t->postinit != NULL) { in self_test_asym_cipher()
608 if (initbld == NULL) in self_test_asym_cipher()
613 if (initparams == NULL) in self_test_asym_cipher()
749 static EVP_RAND_CTX *kat_rand = NULL;
750 static EVP_RAND_CTX *main_rand = NULL;
758 EVP_RAND_CTX *parent_rand = NULL; in set_kat_drbg()
764 if (kat_rand != NULL) in set_kat_drbg()
767 rand = EVP_RAND_fetch(ctx, "TEST-RAND", NULL); in set_kat_drbg()
768 if (rand == NULL) in set_kat_drbg()
771 parent_rand = EVP_RAND_CTX_new(rand, NULL); in set_kat_drbg()
773 if (parent_rand == NULL) in set_kat_drbg()
781 rand = EVP_RAND_fetch(ctx, "HASH-DRBG", NULL); in set_kat_drbg()
782 if (rand == NULL) in set_kat_drbg()
787 if (kat_rand == NULL) in set_kat_drbg()
801 if (!EVP_RAND_instantiate(parent_rand, strength, 0, NULL, 0, drbg_params)) in set_kat_drbg()
805 parent_rand = NULL; in set_kat_drbg()
807 if (!EVP_RAND_instantiate(kat_rand, strength, 0, persstr, persstr_len, NULL)) in set_kat_drbg()
825 kat_rand = NULL; in set_kat_drbg()
834 if (kat_rand != NULL) { in reset_main_drbg()
839 kat_rand = NULL; in reset_main_drbg()
852 rand = EVP_RAND_fetch(libctx, "TEST-RAND", NULL); in setup_main_random()
853 if (rand == NULL) in setup_main_random()
856 main_rand = EVP_RAND_CTX_new(rand, NULL); in setup_main_random()
858 if (main_rand == NULL) in setup_main_random()
866 if (!EVP_RAND_instantiate(main_rand, strength, 0, NULL, 0, drbg_params)) in setup_main_random()
884 if (saved_rand != NULL && !EVP_RAND_CTX_up_ref(saved_rand)) in SELF_TEST_kats()