Lines Matching refs:NULL

29 static OSSL_LIB_CTX *libctx = NULL;
30 static OSSL_PROVIDER *nullprov = NULL;
31 static OSSL_PROVIDER *libprov = NULL;
33 static EVP_PKEY *rkey[TEST_KEYTYPES_P256_X25519] = { NULL, NULL };
34 static EVP_PKEY_CTX *rctx[TEST_KEYTYPES_P256_X25519] = { NULL, NULL };
42 EVP_PKEY *rpub = NULL, *spriv = NULL; in test_dhkem_encapsulate()
46 t->spriv != NULL ? "Auth" : ""); in test_dhkem_encapsulate()
51 if (t->spriv != NULL) { in test_dhkem_encapsulate()
68 EVP_PKEY *rpriv = NULL, *spub = NULL; in test_dhkem_decapsulate()
71 TEST_note("Test %s %s Decapsulate", t->curve, t->spub != NULL ? "Auth" : ""); in test_dhkem_decapsulate()
76 if (t->spub != NULL) { in test_dhkem_decapsulate()
94 return TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1) in test_settables()
109 return TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1) in test_init_multiple()
110 && TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1) in test_init_multiple()
111 && TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), 1) in test_init_multiple()
112 && TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), 1); in test_init_multiple()
119 EVP_PKEY *pkey = NULL; in test_ec_dhkem_derivekey_fail()
121 EVP_PKEY_CTX *genctx = NULL; in test_ec_dhkem_derivekey_fail()
123 BIGNUM *priv = NULL; in test_ec_dhkem_derivekey_fail()
132 if (!TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(libctx, "EC", NULL)) in test_ec_dhkem_derivekey_fail()
174 return TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1) in test_no_operation_set()
175 && TEST_int_eq(EVP_PKEY_encapsulate(ctx, NULL, &len, NULL, NULL), -2) in test_no_operation_set()
176 && TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), 1) in test_no_operation_set()
177 && TEST_int_eq(EVP_PKEY_decapsulate(ctx, NULL, &len, in test_no_operation_set()
216 || !TEST_int_eq(EVP_PKEY_encapsulate(ctx, NULL, &enclen, in test_input_size_small()
217 NULL, &seclen), 1)) in test_input_size_small()
249 EVP_PKEY *auth = NULL; in test_ec_auth_key_curve_mismatch()
251 if (!TEST_ptr(auth = EVP_PKEY_Q_keygen(libctx, NULL, "EC", "P-521"))) in test_ec_auth_key_curve_mismatch()
272 EVP_PKEY *priv = NULL; in test_ec_invalid_private_key()
273 EVP_PKEY_CTX *ctx = NULL; in test_ec_invalid_private_key()
283 && TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL)) in test_ec_invalid_private_key()
284 && TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 0); in test_ec_invalid_private_key()
293 EVP_PKEY *key = NULL; in test_ec_public_key_infinity()
294 EVP_PKEY_CTX *keyctx = NULL; in test_ec_public_key_infinity()
305 && TEST_ptr(keyctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL)) in test_ec_public_key_infinity()
330 return TEST_int_eq(EVP_PKEY_auth_encapsulate_init(ctx, NULL, opparam), 0) in test_null_params()
331 && TEST_int_eq(EVP_PKEY_auth_decapsulate_init(ctx, NULL, opparam), 0) in test_null_params()
334 && TEST_int_eq(EVP_PKEY_decapsulate(ctx, NULL, NULL, in test_null_params()
339 && TEST_int_eq(EVP_PKEY_encapsulate(ctx, NULL, NULL, in test_null_params()
340 NULL, NULL), 0); in test_null_params()
364 NULL, 0); in test_set_params()
376 badparams[0] = OSSL_PARAM_construct_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0); in test_set_params()
396 EVP_PKEY_CTX *ctx = NULL; in test_nopublic()
397 EVP_PKEY *priv = NULL; in test_nopublic()
405 NULL, 0))) in test_nopublic()
407 if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL))) in test_nopublic()
431 EVP_PKEY *auth = NULL; in test_noauthpublic()
440 t->rprivlen, NULL, expected))) in test_noauthpublic()
468 EVP_PKEY *pkey = NULL; in test_ec_dhkem_derivekey()
470 EVP_PKEY_CTX *genctx = NULL; in test_ec_dhkem_derivekey()
475 BIGNUM *priv = NULL; in test_ec_dhkem_derivekey()
483 ret = TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(libctx, "EC", NULL)) in test_ec_dhkem_derivekey()
510 EVP_PKEY_CTX *ctx = NULL; in test_ec_noikme()
511 EVP_PKEY *recip = NULL; in test_ec_noikme()
512 EVP_PKEY *sender_auth = NULL; in test_ec_noikme()
532 if (!TEST_ptr(recip = EVP_PKEY_Q_keygen(libctx, NULL, curve)) in test_ec_noikme()
534 && !TEST_ptr(sender_auth = EVP_PKEY_Q_keygen(libctx, NULL, in test_ec_noikme()
538 if (!TEST_ptr(recip = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve)) in test_ec_noikme()
540 && !TEST_ptr(sender_auth = EVP_PKEY_Q_keygen(libctx, NULL, in test_ec_noikme()
545 ret = TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, recip, NULL)) in test_ec_noikme()
546 && (sender_auth == NULL in test_ec_noikme()
548 NULL), 1)) in test_ec_noikme()
549 && (sender_auth != NULL in test_ec_noikme()
550 || TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1)) in test_ec_noikme()
554 && (sender_auth == NULL in test_ec_noikme()
556 NULL), 1)) in test_ec_noikme()
557 && (sender_auth != NULL in test_ec_noikme()
558 || TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), 1)) in test_ec_noikme()
575 EVP_PKEY *key = NULL; in do_ec_curve_failtest()
576 EVP_PKEY_CTX *ctx = NULL; in do_ec_curve_failtest()
578 ret = TEST_ptr(key = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve)) in do_ec_curve_failtest()
579 && TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL)) in do_ec_curve_failtest()
580 && TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), -2) in do_ec_curve_failtest()
581 && TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), -2); in do_ec_curve_failtest()
601 EVP_PKEY *recippriv = NULL; in test_ec_badpublic()
602 EVP_PKEY_CTX *ctx = NULL; in test_ec_badpublic()
616 if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, recippriv, NULL))) in test_ec_badpublic()
649 EVP_PKEY *auth = NULL; in test_ec_badauth()
711 EVP_PKEY *pkey = NULL; in test_ecx_dhkem_derivekey()
736 ret = TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(libctx, t->curvename, NULL)) in test_ecx_dhkem_derivekey()
758 EVP_PKEY *auth = NULL; in test_ecx_auth_key_curve_mismatch()
760 if (!TEST_ptr(auth = EVP_PKEY_Q_keygen(libctx, NULL, "X448"))) in test_ecx_auth_key_curve_mismatch()
773 EVP_PKEY *key = NULL; in test_ed_curve_unsupported()
774 EVP_PKEY_CTX *ctx = NULL; in test_ed_curve_unsupported()
776 ret = TEST_ptr(key = EVP_PKEY_Q_keygen(libctx, NULL, "ED448")) in test_ed_curve_unsupported()
777 && TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL)) in test_ed_curve_unsupported()
778 && TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), -2) in test_ed_curve_unsupported()
779 && TEST_int_eq(EVP_PKEY_decapsulate_init(ctx, NULL), -2); in test_ed_curve_unsupported()
789 char *config_file = NULL; in setup_tests()
799 if (!TEST_ptr(rkey[TEST_KEYTYPE_P256] = EVP_PKEY_Q_keygen(libctx, NULL, in setup_tests()
803 if (!TEST_ptr(rkey[TEST_KEYTYPE_X25519] = EVP_PKEY_Q_keygen(libctx, NULL, in setup_tests()
809 rkey[TEST_KEYTYPE_P256], NULL))) in setup_tests()
814 rkey[TEST_KEYTYPE_X25519], NULL))) in setup_tests()