CK_MECHANISM gostMech = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL, 0 };
...
C_GenerateKeyPair(hSession, &gostMech, NULL_PTR, 0, NULL_PTR, 0, &hPubKey, &hPrvKey);
-> CKR_OK and Generate RSA Key Pair


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3887 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
s 2009-12-08 18:28:22 +00:00
parent 22a950cd0d
commit 425ec51f78
1 changed files with 3 additions and 1 deletions

View File

@ -1635,8 +1635,10 @@ static CK_RV pkcs15_gen_keypair(struct sc_pkcs11_card *p11card,
rv = attr_find2(pPubTpl, ulPubCnt, pPrivTpl, ulPrivCnt, CKA_KEY_TYPE,
&keytype, NULL);
if (rv != CKR_OK)
if (rv != CKR_OK && pMechanism->mechanism == CKM_RSA_PKCS_KEY_PAIR_GEN)
keytype = CKK_RSA;
else
goto kpgen_done;
if (keytype == CKK_GOSTR3410)
{
keygen_args.prkey_args.key.algorithm = SC_ALGORITHM_GOSTR3410;