Lines Matching refs:pkey
365 EVP_PKEY *pkey = NULL; in test_dh_paramgen() local
377 && TEST_true(EVP_PKEY_paramgen(gctx, &pkey)) in test_dh_paramgen()
378 && TEST_ptr(pkey); in test_dh_paramgen()
383 ret = ret && TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dh_paramgen()
388 EVP_PKEY_free(pkey); in test_dh_paramgen()
450 EVP_PKEY *pkey = NULL; in test_d2i_AutoPrivateKey_ex() local
460 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &p, input_len, mainctx, in test_d2i_AutoPrivateKey_ex()
463 || !TEST_int_eq(EVP_PKEY_get_id(pkey), expected_id)) in test_d2i_AutoPrivateKey_ex()
467 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_D, in test_d2i_AutoPrivateKey_ex()
474 if (!TEST_true(EVP_PKEY_get_octet_string_param(pkey, in test_d2i_AutoPrivateKey_ex()
480 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_PRIV_KEY, in test_d2i_AutoPrivateKey_ex()
486 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_FFC_P, &p_bn)) in test_d2i_AutoPrivateKey_ex()
487 || !TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_FFC_G, in test_d2i_AutoPrivateKey_ex()
497 EVP_PKEY_free(pkey); in test_d2i_AutoPrivateKey_ex()
507 EVP_PKEY *pkey = NULL, *pkey_dec = NULL; in test_pkcs8key_nid_bio() local
517 && TEST_ptr(pkey = d2i_PrivateKey_ex_bio(in, NULL, NULL, NULL)) in test_pkcs8key_nid_bio()
518 && TEST_int_eq(i2d_PKCS8PrivateKey_nid_bio(enc_bio, pkey, nid, in test_pkcs8key_nid_bio()
524 && TEST_true(EVP_PKEY_eq(pkey, pkey_dec)); in test_pkcs8key_nid_bio()
527 EVP_PKEY_free(pkey); in test_pkcs8key_nid_bio()
613 EVP_PKEY *pkey = NULL; in test_d2i_PrivateKey_ex() local
620 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_d2i_PrivateKey_ex()
626 ok = TEST_ptr(pkey = d2i_PrivateKey_bio(key_bio, NULL)); in test_d2i_PrivateKey_ex()
631 EVP_PKEY_free(pkey); in test_d2i_PrivateKey_ex()
643 EVP_PKEY *pkey = NULL; in test_PEM_read_bio_negative() local
648 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
657 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
666 EVP_PKEY_free(pkey); in test_PEM_read_bio_negative()
723 EVP_PKEY *pkey = NULL; in do_fromdata_key_is_equal() local
728 && TEST_int_eq(EVP_PKEY_fromdata(ctx, &pkey, in do_fromdata_key_is_equal()
731 && TEST_true(EVP_PKEY_eq(pkey, expected)); in do_fromdata_key_is_equal()
733 EVP_PKEY_free(pkey); in do_fromdata_key_is_equal()
891 EVP_PKEY *pkey = NULL; in do_check_params() local
896 && TEST_int_eq(EVP_PKEY_fromdata(gen_ctx, &pkey, in do_check_params()
898 && TEST_ptr(check_ctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, in do_check_params()
903 EVP_PKEY_free(pkey); in do_check_params()
949 EVP_PKEY *pkey = NULL; in test_dsa_todata() local
972 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pkeydata, sizeof(dsa_key), in test_dsa_todata()
974 || !TEST_int_eq(EVP_PKEY_todata(pkey, EVP_PKEY_KEYPAIR, &to_params), 1) in test_dsa_todata()
991 if (!do_fromdata_key_is_equal(to_params, pkey, "DSA")) in test_dsa_todata()
1020 EVP_PKEY_free(pkey); in test_dsa_todata()
1035 EVP_PKEY *pkey = NULL, *pkey2 = NULL; in test_dsa_fromdata_digest_prop() local
1050 || !TEST_int_eq(EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params), 1)) in test_dsa_fromdata_digest_prop()
1053 if (!TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dsa_fromdata_digest_prop()
1061 EVP_PKEY_free(pkey); in test_dsa_fromdata_digest_prop()
1071 EVP_PKEY *pkey = NULL; in test_pkey_todata_null() local
1075 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_todata_null()
1078 && TEST_int_eq(EVP_PKEY_todata(pkey, EVP_PKEY_KEYPAIR, NULL), 0); in test_pkey_todata_null()
1079 EVP_PKEY_free(pkey); in test_pkey_todata_null()
1094 EVP_PKEY *pkey = NULL; in test_pkey_export_null() local
1098 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_export_null()
1102 && TEST_int_eq(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, NULL, NULL), 0); in test_pkey_export_null()
1103 EVP_PKEY_free(pkey); in test_pkey_export_null()
1109 EVP_PKEY *pkey = NULL; in test_pkey_export() local
1117 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, pdata_len, in test_pkey_export()
1119 || !TEST_true(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1120 test_pkey_export_cb, pkey)) in test_pkey_export()
1121 || !TEST_false(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1124 EVP_PKEY_free(pkey); in test_pkey_export()
1131 || !TEST_ptr(pkey = EVP_PKEY_new()) in test_pkey_export()
1132 || !TEST_true(EVP_PKEY_assign_RSA(pkey, rsa)) in test_pkey_export()
1133 || !TEST_true(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1134 test_pkey_export_cb, pkey)) in test_pkey_export()
1135 || !TEST_false(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1138 EVP_PKEY_free(pkey); in test_pkey_export()
1145 EVP_PKEY *pkey = NULL; in test_rsa_pss_sign() local
1162 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_rsa_pss_sign()
1164 && TEST_ptr(pctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_rsa_pss_sign()
1175 EVP_PKEY_free(pkey); in test_rsa_pss_sign()