Update CPK sub-lib

Use simple NID as arguments, and fix some bugs
This commit is contained in:
Zhi Guan
2018-10-21 19:43:40 +08:00
parent ce1763c9ea
commit 9eadfd4cb6
19 changed files with 5849 additions and 5740 deletions

View File

@@ -71,12 +71,7 @@ int main(int argc, char **argv)
return 0;
}
if (!(map = CPK_MAP_new_default())
|| !(ec_key = EC_KEY_new_by_curve_name(NID_sm2p256v1))
|| !EC_KEY_generate_key(ec_key)
|| !(pkey = EVP_PKEY_new())
|| !EVP_PKEY_set1_EC_KEY(pkey, ec_key)
|| !(msk = CPK_MASTER_SECRET_create("codesign", pkey, map))
if (!(msk = CPK_MASTER_SECRET_create("codesign", 0, NID_cpk_map_sha1))
|| !(mpk = CPK_MASTER_SECRET_extract_public_params(msk))) {
ERR_print_errors_fp(stderr);
goto end;