Lines Matching refs:NULL

38 static OSSL_LIB_CTX *libctx = NULL;
39 static OSSL_PROVIDER *nullprov = NULL;
40 static OSSL_PROVIDER *libprov = NULL;
41 static STACK_OF(OPENSSL_STRING) *cipher_names = NULL;
59 { NULL } in test_get_options()
78 EVP_CIPHER_CTX *ctx = NULL; in test_evp_cipher_api_safety()
116 EVP_PKEY_CTX *gen_ctx = NULL; in test_dsa_param_keygen()
117 EVP_PKEY *pkey_parm = NULL; in test_dsa_param_keygen()
118 EVP_PKEY *pkey = NULL, *dup_pk = NULL; in test_dsa_param_keygen()
119 DSA *dsa = NULL; in test_dsa_param_keygen()
121 BIGNUM *p = NULL, *q = NULL, *g = NULL; in test_dsa_param_keygen()
152 p = q = g = NULL; in test_dsa_param_keygen()
156 dsa = NULL; in test_dsa_param_keygen()
158 if (!TEST_ptr(gen_ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey_parm, NULL)) in test_dsa_param_keygen()
188 EVP_PKEY_CTX *gen_ctx = NULL; in do_dh_param_keygen()
189 EVP_PKEY *pkey_parm = NULL; in do_dh_param_keygen()
190 EVP_PKEY *pkey = NULL, *dup_pk = NULL; in do_dh_param_keygen()
191 DH *dh = NULL; in do_dh_param_keygen()
193 BIGNUM *p = NULL, *q = NULL, *g = NULL; in do_dh_param_keygen()
215 p = q = g = NULL; in do_dh_param_keygen()
219 dh = NULL; in do_dh_param_keygen()
221 if (!TEST_ptr(gen_ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey_parm, NULL)) in do_dh_param_keygen()
262 X509 *cert = NULL; in dhx_cert_load()
263 BIO *bio = NULL; in dhx_cert_load()
334 || !TEST_ptr(cert = X509_new_ex(libctx, NULL)) in dhx_cert_load()
350 EVP_CIPHER *cipher = NULL; in test_cipher_reinit()
351 EVP_CIPHER_CTX *ctx = NULL; in test_cipher_reinit()
383 if (!TEST_ptr(cipher = EVP_CIPHER_fetch(libctx, name, NULL))) in test_cipher_reinit()
402 if (!TEST_true(EVP_EncryptInit_ex(ctx, cipher, NULL, key, iv)) in test_cipher_reinit()
404 || !TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv)) in test_cipher_reinit()
408 && (!TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv)) in test_cipher_reinit()
442 EVP_CIPHER *cipher = NULL; in test_cipher_reinit_partialupdate()
443 EVP_CIPHER_CTX *ctx = NULL; in test_cipher_reinit_partialupdate()
477 if (!TEST_ptr(cipher = EVP_CIPHER_fetch(libctx, name, NULL))) in test_cipher_reinit_partialupdate()
496 if (!TEST_true(EVP_EncryptInit_ex(ctx, cipher, NULL, key, iv)) in test_cipher_reinit_partialupdate()
498 || !TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv)) in test_cipher_reinit_partialupdate()
507 if (!TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv)) in test_cipher_reinit_partialupdate()
531 char *namedup = NULL; in collect_cipher_names()
537 assert(name != NULL); in collect_cipher_names()
539 if ((namedup = OPENSSL_strdup(name)) != NULL in collect_cipher_names()
547 unsigned char *pub_der = NULL; in rsa_keygen()
548 const unsigned char *pp = NULL; in rsa_keygen()
550 OSSL_ENCODER_CTX *ectx = NULL; in rsa_keygen()
552 if (!TEST_ptr(*priv = EVP_PKEY_Q_keygen(libctx, NULL, "RSA", (size_t)bits)) in rsa_keygen()
557 NULL)) in rsa_keygen()
573 EVP_PKEY *pub = NULL; in kem_rsa_gen_recover()
574 EVP_PKEY *priv = NULL; in kem_rsa_gen_recover()
575 EVP_PKEY_CTX *sctx = NULL, *rctx = NULL, *dctx = NULL; in kem_rsa_gen_recover()
583 && TEST_ptr(sctx = EVP_PKEY_CTX_new_from_pkey(libctx, pub, NULL)) in kem_rsa_gen_recover()
584 && TEST_int_eq(EVP_PKEY_encapsulate_init(sctx, NULL), 1) in kem_rsa_gen_recover()
588 && TEST_int_eq(EVP_PKEY_encapsulate(dctx, NULL, NULL, NULL, NULL), 0) in kem_rsa_gen_recover()
589 && TEST_int_eq(EVP_PKEY_encapsulate(dctx, NULL, &ctlen, NULL, in kem_rsa_gen_recover()
595 && TEST_ptr(rctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL)) in kem_rsa_gen_recover()
596 && TEST_int_eq(EVP_PKEY_decapsulate_init(rctx, NULL), 1) in kem_rsa_gen_recover()
599 && TEST_int_eq(EVP_PKEY_decapsulate(rctx, NULL, NULL, ct, ctlen), 0) in kem_rsa_gen_recover()
600 && TEST_int_eq(EVP_PKEY_decapsulate(rctx, NULL, &unwraplen, in kem_rsa_gen_recover()
634 EVP_CIPHER_CTX *ctx = NULL; in test_cipher_tdes_randkey()
635 EVP_CIPHER *tdes_cipher = NULL, *aes_cipher = NULL; in test_cipher_tdes_randkey()
642 ret = TEST_ptr(aes_cipher = EVP_CIPHER_fetch(libctx, "AES-256-CBC", NULL)) in test_cipher_tdes_randkey()
644 && TEST_ptr(tdes_cipher = EVP_CIPHER_fetch(libctx, "DES-EDE3-CBC", NULL)) in test_cipher_tdes_randkey()
647 && TEST_true(EVP_CipherInit_ex2(ctx, tdes_cipher, NULL, NULL, 1, in test_cipher_tdes_randkey()
661 EVP_PKEY *pub = NULL; in kem_rsa_params()
662 EVP_PKEY *priv = NULL; in kem_rsa_params()
663 EVP_PKEY_CTX *pubctx = NULL, *privctx = NULL; in kem_rsa_params()
669 && TEST_ptr(pubctx = EVP_PKEY_CTX_new_from_pkey(libctx, pub, NULL)) in kem_rsa_params()
670 && TEST_ptr(privctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL)) in kem_rsa_params()
674 && TEST_int_eq(EVP_PKEY_encapsulate_init(NULL, NULL), 0) in kem_rsa_params()
675 && TEST_int_eq(EVP_PKEY_encapsulate(NULL, NULL, NULL, NULL, NULL), 0) in kem_rsa_params()
676 && TEST_int_eq(EVP_PKEY_decapsulate_init(NULL, NULL), 0) in kem_rsa_params()
677 && TEST_int_eq(EVP_PKEY_decapsulate(NULL, NULL, NULL, NULL, 0), 0) in kem_rsa_params()
679 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, NULL, NULL, NULL), -1) in kem_rsa_params()
680 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, NULL, NULL, NULL, 0), 0) in kem_rsa_params()
682 && TEST_int_eq(EVP_PKEY_decapsulate_init(pubctx, NULL), 1) in kem_rsa_params()
688 && TEST_int_eq(EVP_PKEY_encapsulate_init(pubctx, NULL), 1) in kem_rsa_params()
692 && TEST_int_eq(EVP_PKEY_CTX_set_kem_op(pubctx, NULL), 0) in kem_rsa_params()
693 && TEST_int_eq(EVP_PKEY_CTX_set_kem_op(NULL, "RSASVE"), 0) in kem_rsa_params()
694 && TEST_int_eq(EVP_PKEY_CTX_set_kem_op(NULL, NULL), 0) in kem_rsa_params()
697 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, &ctlen, NULL, NULL), 1) in kem_rsa_params()
698 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, ct, &ctlen, secret, NULL), 1) in kem_rsa_params()
699 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, &ctlen, NULL, NULL), 1) in kem_rsa_params()
701 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, NULL, NULL, &secretlen), 1) in kem_rsa_params()
702 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, ct, NULL, secret, &secretlen), 1) in kem_rsa_params()
704 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, NULL, NULL, NULL), 0) in kem_rsa_params()
705 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, &ctlen, NULL, NULL), 1) in kem_rsa_params()
706 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, NULL, NULL, &secretlen), 1) in kem_rsa_params()
707 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, &ctlen, NULL, &secretlen), 1) in kem_rsa_params()
709 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, ct, &ctlen, NULL, NULL), 0) in kem_rsa_params()
711 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, ct, NULL, secret, NULL), 1) in kem_rsa_params()
713 && TEST_int_eq(EVP_PKEY_decapsulate_init(privctx, NULL), 1) in kem_rsa_params()
715 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, secret, NULL, ct, sizeof(ct)), 1) in kem_rsa_params()
716 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, NULL, &secretlen, ct, sizeof(ct)), 1) in kem_rsa_params()
719 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, NULL, NULL, ct, sizeof(ct)), 0) in kem_rsa_params()
720 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, secret, &secretlen, NULL, 0), 0) in kem_rsa_params()
721 && TEST_int_eq(EVP_PKEY_decapsulate(privctx, secret, &secretlen, NULL, sizeof(ct)), 0) in kem_rsa_params()
734 EVP_PKEY_CTX *gctx = NULL; in gen_dh_key()
735 EVP_PKEY *pkey = NULL; in gen_dh_key()
741 if (!TEST_ptr(gctx = EVP_PKEY_CTX_new_from_name(libctx, "DH", NULL)) in gen_dh_key()
755 EVP_PKEY *key = NULL; in kem_invalid_keytype()
756 EVP_PKEY_CTX *sctx = NULL; in kem_invalid_keytype()
761 if (!TEST_ptr(sctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL))) in kem_invalid_keytype()
763 if (!TEST_int_eq(EVP_PKEY_encapsulate_init(sctx, NULL), -2)) in kem_invalid_keytype()
777 char *config_file = NULL; in setup_tests()