Lines Matching refs:NULL

31 static OSSL_LIB_CTX *mainctx = NULL;
32 static OSSL_PROVIDER *nullprov = NULL;
274 NULL); in pkey_has_private()
276 BIGNUM *bn = NULL; in pkey_has_private()
287 OSSL_PARAM *pub_params = NULL, *keypair_params = NULL; in do_pkey_tofrom_data_select()
288 EVP_PKEY *fromkey = NULL, *fromkeypair = NULL; in do_pkey_tofrom_data_select()
289 EVP_PKEY_CTX *fromctx = NULL; in do_pkey_tofrom_data_select()
312 if (!TEST_ptr(fromctx = EVP_PKEY_CTX_new_from_name(mainctx, keytype, NULL)) in do_pkey_tofrom_data_select()
341 EVP_PKEY *key = NULL; in test_dh_tofrom_data_select()
342 EVP_PKEY_CTX *gctx = NULL; in test_dh_tofrom_data_select()
350 ret = TEST_ptr(gctx = EVP_PKEY_CTX_new_from_name(mainctx, "DHX", NULL)) in test_dh_tofrom_data_select()
369 EVP_PKEY *pkey = NULL; in test_dh_paramgen()
370 EVP_PKEY_CTX *gctx = NULL; in test_dh_paramgen()
378 ret = TEST_ptr(gctx = EVP_PKEY_CTX_new_from_name(mainctx, "DH", NULL)) in test_dh_paramgen()
385 gctx = NULL; in test_dh_paramgen()
387 ret = ret && TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dh_paramgen()
400 EVP_PKEY *pkey = NULL; in set_fromdata_string()
416 EVP_PKEY *pkey = NULL; in set_fromdata_uint()
429 EVP_PKEY_CTX *ctx = NULL; in test_dh_paramfromdata()
433 ret = TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(mainctx, "DH", NULL)) in test_dh_paramfromdata()
458 FILE *fp = NULL; in test_ec_d2i_i2d_pubkey()
459 EVP_PKEY *key = NULL, *outkey = NULL; in test_ec_d2i_i2d_pubkey()
463 || !TEST_ptr(key = EVP_PKEY_Q_keygen(mainctx, NULL, "EC", "P-256")) in test_ec_d2i_i2d_pubkey()
467 fp = NULL; in test_ec_d2i_i2d_pubkey()
470 || !TEST_ptr(outkey = d2i_PUBKEY_ex_fp(fp, NULL, mainctx, NULL)) in test_ec_d2i_i2d_pubkey()
486 EVP_PKEY *key = NULL; in test_ec_tofrom_data_select()
488 ret = TEST_ptr(key = EVP_PKEY_Q_keygen(mainctx, NULL, "EC", "P-256")) in test_ec_tofrom_data_select()
498 EVP_PKEY *key = NULL; in test_ecx_tofrom_data_select()
500 ret = TEST_ptr(key = EVP_PKEY_Q_keygen(mainctx, NULL, "X25519")) in test_ecx_tofrom_data_select()
512 EVP_PKEY *key = NULL; in test_sm2_tofrom_data_select()
514 ret = TEST_ptr(key = EVP_PKEY_Q_keygen(mainctx, NULL, "SM2")) in test_sm2_tofrom_data_select()
524 EVP_PKEY *key = NULL; in test_rsa_tofrom_data_select()
528 ret = TEST_ptr(key = d2i_AutoPrivateKey_ex(NULL, &pdata, pdata_len, in test_rsa_tofrom_data_select()
529 mainctx, NULL)) in test_rsa_tofrom_data_select()
540 EVP_PKEY *pkey = NULL; in test_d2i_AutoPrivateKey_ex()
545 BIGNUM *p_bn = NULL; in test_d2i_AutoPrivateKey_ex()
546 BIGNUM *g_bn = NULL; in test_d2i_AutoPrivateKey_ex()
547 BIGNUM *priv_bn = NULL; in test_d2i_AutoPrivateKey_ex()
550 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &p, input_len, mainctx, in test_d2i_AutoPrivateKey_ex()
551 NULL)) in test_d2i_AutoPrivateKey_ex()
597 EVP_PKEY *pkey = NULL, *pkey_dec = NULL; in test_pkcs8key_nid_bio()
598 BIO *in = NULL, *enc_bio = NULL; in test_pkcs8key_nid_bio()
599 char *enc_data = NULL; in test_pkcs8key_nid_bio()
601 OSSL_PROVIDER *provider = NULL; in test_pkcs8key_nid_bio()
603 ret = TEST_ptr(provider = OSSL_PROVIDER_load(NULL, "default")) in test_pkcs8key_nid_bio()
607 && TEST_ptr(pkey = d2i_PrivateKey_ex_bio(in, NULL, NULL, NULL)) in test_pkcs8key_nid_bio()
610 NULL, NULL), 1) in test_pkcs8key_nid_bio()
612 && TEST_ptr(pkey_dec = d2i_PKCS8PrivateKey_bio(enc_bio, NULL, NULL, in test_pkcs8key_nid_bio()
635 if (!TEST_ptr_null(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) in test_alternative_default()
643 || !TEST_ptr(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) in test_alternative_default()
646 sha256 = NULL; in test_alternative_default()
653 || !TEST_ptr_null(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) in test_alternative_default()
664 EVP_MD *sha256 = NULL; in test_provider_unload_effective()
665 OSSL_PROVIDER *provider = NULL; in test_provider_unload_effective()
668 if (!TEST_ptr(provider = OSSL_PROVIDER_load(NULL, "default")) in test_provider_unload_effective()
669 || !TEST_ptr(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) in test_provider_unload_effective()
674 provider = NULL; in test_provider_unload_effective()
676 sha256 = NULL; in test_provider_unload_effective()
679 sha256 = NULL; in test_provider_unload_effective()
681 provider = NULL; in test_provider_unload_effective()
688 if (!TEST_ptr_null(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) in test_provider_unload_effective()
701 OSSL_PROVIDER *provider = NULL; in test_d2i_PrivateKey_ex()
702 BIO *key_bio = NULL; in test_d2i_PrivateKey_ex()
703 EVP_PKEY *pkey = NULL; in test_d2i_PrivateKey_ex()
706 if (!TEST_ptr(provider = OSSL_PROVIDER_load(NULL, "default"))) in test_d2i_PrivateKey_ex()
710 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_d2i_PrivateKey_ex()
716 ok = TEST_ptr(pkey = d2i_PrivateKey_bio(key_bio, NULL)); in test_d2i_PrivateKey_ex()
731 OSSL_PROVIDER *provider = NULL; in test_PEM_read_bio_negative()
732 BIO *key_bio = NULL; in test_PEM_read_bio_negative()
733 EVP_PKEY *pkey = NULL; in test_PEM_read_bio_negative()
738 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
742 if (!TEST_ptr(provider = OSSL_PROVIDER_load(NULL, "default"))) in test_PEM_read_bio_negative()
747 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
766 OSSL_PROVIDER *provider = OSSL_PROVIDER_load(NULL, "default"); in test_PEM_read_bio_negative_wrong_password()
767 EVP_PKEY *read_pkey = NULL; in test_PEM_read_bio_negative_wrong_password()
770 const UI_METHOD *undo_ui_method = NULL; in test_PEM_read_bio_negative_wrong_password()
771 const UI_METHOD *ui_method = NULL; in test_PEM_read_bio_negative_wrong_password()
786 NULL, 0, NULL, "pass"))) in test_PEM_read_bio_negative_wrong_password()
790 read_pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL); in test_PEM_read_bio_negative_wrong_password()
812 EVP_PKEY_CTX *ctx = NULL; in do_fromdata_key_is_equal()
813 EVP_PKEY *pkey = NULL; in do_fromdata_key_is_equal()
816 ret = TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(mainctx, type, NULL)) in do_fromdata_key_is_equal()
980 EVP_PKEY_CTX *gen_ctx = NULL, *check_ctx = NULL; in do_check_params()
981 EVP_PKEY *pkey = NULL; in do_check_params()
984 ret = TEST_ptr(gen_ctx = EVP_PKEY_CTX_new_from_name(mainctx, "DSA", NULL)) in do_check_params()
989 NULL)) in do_check_params()
1001 BIGNUM *bn = NULL; in do_check_bn()
1026 EVP_PKEY *key = NULL; in test_dsa_tofrom_data_select()
1029 ret = TEST_ptr(key = d2i_AutoPrivateKey_ex(NULL, &pkeydata, sizeof(dsa_key), in test_dsa_tofrom_data_select()
1030 mainctx, NULL)) in test_dsa_tofrom_data_select()
1039 EVP_PKEY *pkey = NULL; in test_dsa_todata()
1040 OSSL_PARAM *to_params = NULL, *all_params = NULL; in test_dsa_todata()
1062 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pkeydata, sizeof(dsa_key), in test_dsa_todata()
1063 mainctx, NULL)) in test_dsa_todata()
1124 EVP_PKEY_CTX *ctx = NULL, *gctx = NULL; in test_dsa_fromdata_digest_prop()
1125 EVP_PKEY *pkey = NULL, *pkey2 = NULL; in test_dsa_fromdata_digest_prop()
1138 if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(mainctx, "DSA", NULL)) in test_dsa_fromdata_digest_prop()
1143 if (!TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dsa_fromdata_digest_prop()
1160 OSSL_PARAM *params = NULL; in test_pkey_todata_null()
1161 EVP_PKEY *pkey = NULL; in test_pkey_todata_null()
1165 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_todata_null()
1166 mainctx, NULL)) in test_pkey_todata_null()
1167 && TEST_int_eq(EVP_PKEY_todata(NULL, EVP_PKEY_KEYPAIR, &params), 0) in test_pkey_todata_null()
1168 && TEST_int_eq(EVP_PKEY_todata(pkey, EVP_PKEY_KEYPAIR, NULL), 0); in test_pkey_todata_null()
1177 if (arg == NULL) in test_pkey_export_cb()
1184 EVP_PKEY *pkey = NULL; in test_pkey_export_null()
1188 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_export_null()
1189 mainctx, NULL)) in test_pkey_export_null()
1190 && TEST_int_eq(EVP_PKEY_export(NULL, EVP_PKEY_KEYPAIR, in test_pkey_export_null()
1191 test_pkey_export_cb, NULL), 0) in test_pkey_export_null()
1192 && TEST_int_eq(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, NULL, NULL), 0); in test_pkey_export_null()
1199 EVP_PKEY *pkey = NULL; in test_pkey_export()
1201 RSA *rsa = NULL; in test_pkey_export()
1207 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, pdata_len, in test_pkey_export()
1208 mainctx, NULL)) in test_pkey_export()
1212 test_pkey_export_cb, NULL))) in test_pkey_export()
1220 if (!TEST_ptr(rsa = d2i_RSAPrivateKey(NULL, &pdata, pdata_len)) in test_pkey_export()
1226 test_pkey_export_cb, NULL))) in test_pkey_export()
1235 EVP_PKEY *pkey = NULL; in test_rsa_pss_sign()
1236 EVP_PKEY_CTX *pctx = NULL; in test_rsa_pss_sign()
1243 unsigned char *sig = NULL; in test_rsa_pss_sign()
1252 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_rsa_pss_sign()
1253 mainctx, NULL)) in test_rsa_pss_sign()
1254 && TEST_ptr(pctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_rsa_pss_sign()
1256 && TEST_int_gt(EVP_PKEY_sign(pctx, NULL, &sig_len, mdbuf, in test_rsa_pss_sign()
1273 EVP_MD_CTX *copyctx = NULL; in test_evp_md_ctx_dup()
1287 EVP_MD_CTX *mdctx = NULL; in test_evp_md_ctx_copy()
1288 EVP_MD_CTX *copyctx = NULL; in test_evp_md_ctx_copy()
1306 EVP_PBE_KEYGEN_EX *keygen_ex = NULL; in test_evp_pbe_alg_add()
1307 EVP_PBE_KEYGEN *keygen = NULL; in test_evp_pbe_alg_add()
1317 if (!TEST_true(keygen != NULL)) in test_evp_pbe_alg_add()
1319 if (!TEST_true(keygen_ex == NULL)) in test_evp_pbe_alg_add()
1339 if (!TEST_ptr_null(md = EVP_MD_fetch(mainctx, "SHA256:BogusName", NULL))) { in evp_test_name_parsing()
1349 if (!test_get_libctx(&mainctx, &nullprov, NULL, NULL, NULL)) { in setup_tests()
1351 mainctx = NULL; in setup_tests()