Lines Matching refs:pkey

377     EVP_PKEY *pkey = NULL;  in test_dh_paramgen()  local
389 && TEST_true(EVP_PKEY_paramgen(gctx, &pkey)) in test_dh_paramgen()
390 && TEST_ptr(pkey); in test_dh_paramgen()
395 ret = ret && TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dh_paramgen()
400 EVP_PKEY_free(pkey); in test_dh_paramgen()
408 EVP_PKEY *pkey = NULL; in set_fromdata_string() local
414 ret = EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params); in set_fromdata_string()
415 EVP_PKEY_free(pkey); in set_fromdata_string()
424 EVP_PKEY *pkey = NULL; in set_fromdata_uint() local
430 ret = EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params); in set_fromdata_uint()
431 EVP_PKEY_free(pkey); in set_fromdata_uint()
594 EVP_PKEY *pkey = NULL; in test_d2i_AutoPrivateKey_ex() local
604 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &p, input_len, mainctx, in test_d2i_AutoPrivateKey_ex()
607 || !TEST_int_eq(EVP_PKEY_get_id(pkey), expected_id)) in test_d2i_AutoPrivateKey_ex()
611 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_D, in test_d2i_AutoPrivateKey_ex()
618 if (!TEST_true(EVP_PKEY_get_octet_string_param(pkey, in test_d2i_AutoPrivateKey_ex()
624 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_PRIV_KEY, in test_d2i_AutoPrivateKey_ex()
630 if (!TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_FFC_P, &p_bn)) in test_d2i_AutoPrivateKey_ex()
631 || !TEST_true(EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_FFC_G, in test_d2i_AutoPrivateKey_ex()
641 EVP_PKEY_free(pkey); in test_d2i_AutoPrivateKey_ex()
651 EVP_PKEY *pkey = NULL, *pkey_dec = NULL; in test_pkcs8key_nid_bio() local
661 && TEST_ptr(pkey = d2i_PrivateKey_ex_bio(in, NULL, NULL, NULL)) in test_pkcs8key_nid_bio()
662 && TEST_int_eq(i2d_PKCS8PrivateKey_nid_bio(enc_bio, pkey, nid, in test_pkcs8key_nid_bio()
668 && TEST_true(EVP_PKEY_eq(pkey, pkey_dec)); in test_pkcs8key_nid_bio()
671 EVP_PKEY_free(pkey); in test_pkcs8key_nid_bio()
757 EVP_PKEY *pkey = NULL; in test_d2i_PrivateKey_ex() local
764 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_d2i_PrivateKey_ex()
770 ok = TEST_ptr(pkey = d2i_PrivateKey_bio(key_bio, NULL)); in test_d2i_PrivateKey_ex()
775 EVP_PKEY_free(pkey); in test_d2i_PrivateKey_ex()
787 EVP_PKEY *pkey = NULL; in test_PEM_read_bio_negative() local
792 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
801 if (!TEST_ptr_null(pkey = PEM_read_bio_PrivateKey(key_bio, NULL, NULL, NULL))) in test_PEM_read_bio_negative()
810 EVP_PKEY_free(pkey); in test_PEM_read_bio_negative()
867 EVP_PKEY *pkey = NULL; in do_fromdata_key_is_equal() local
872 && TEST_int_eq(EVP_PKEY_fromdata(ctx, &pkey, in do_fromdata_key_is_equal()
875 && TEST_true(EVP_PKEY_eq(pkey, expected)); in do_fromdata_key_is_equal()
877 EVP_PKEY_free(pkey); in do_fromdata_key_is_equal()
1035 EVP_PKEY *pkey = NULL; in do_check_params() local
1040 && TEST_int_eq(EVP_PKEY_fromdata(gen_ctx, &pkey, in do_check_params()
1042 && TEST_ptr(check_ctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, in do_check_params()
1047 EVP_PKEY_free(pkey); in do_check_params()
1093 EVP_PKEY *pkey = NULL; in test_dsa_todata() local
1116 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pkeydata, sizeof(dsa_key), in test_dsa_todata()
1118 || !TEST_int_eq(EVP_PKEY_todata(pkey, EVP_PKEY_KEYPAIR, &to_params), 1) in test_dsa_todata()
1135 if (!do_fromdata_key_is_equal(to_params, pkey, "DSA")) in test_dsa_todata()
1164 EVP_PKEY_free(pkey); in test_dsa_todata()
1179 EVP_PKEY *pkey = NULL, *pkey2 = NULL; in test_dsa_fromdata_digest_prop() local
1194 || !TEST_int_eq(EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params), 1)) in test_dsa_fromdata_digest_prop()
1197 if (!TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_dsa_fromdata_digest_prop()
1205 EVP_PKEY_free(pkey); in test_dsa_fromdata_digest_prop()
1215 EVP_PKEY *pkey = NULL; in test_pkey_todata_null() local
1219 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_todata_null()
1222 && TEST_int_eq(EVP_PKEY_todata(pkey, EVP_PKEY_KEYPAIR, NULL), 0); in test_pkey_todata_null()
1223 EVP_PKEY_free(pkey); in test_pkey_todata_null()
1238 EVP_PKEY *pkey = NULL; in test_pkey_export_null() local
1242 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_pkey_export_null()
1246 && TEST_int_eq(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, NULL, NULL), 0); in test_pkey_export_null()
1247 EVP_PKEY_free(pkey); in test_pkey_export_null()
1253 EVP_PKEY *pkey = NULL; in test_pkey_export() local
1261 if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, pdata_len, in test_pkey_export()
1263 || !TEST_true(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1264 test_pkey_export_cb, pkey)) in test_pkey_export()
1265 || !TEST_false(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1268 EVP_PKEY_free(pkey); in test_pkey_export()
1275 || !TEST_ptr(pkey = EVP_PKEY_new()) in test_pkey_export()
1276 || !TEST_true(EVP_PKEY_assign_RSA(pkey, rsa)) in test_pkey_export()
1277 || !TEST_true(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1278 test_pkey_export_cb, pkey)) in test_pkey_export()
1279 || !TEST_false(EVP_PKEY_export(pkey, EVP_PKEY_KEYPAIR, in test_pkey_export()
1282 EVP_PKEY_free(pkey); in test_pkey_export()
1289 EVP_PKEY *pkey = NULL; in test_rsa_pss_sign() local
1306 ret = TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &pdata, keydata[0].size, in test_rsa_pss_sign()
1308 && TEST_ptr(pctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL)) in test_rsa_pss_sign()
1319 EVP_PKEY_free(pkey); in test_rsa_pss_sign()