Add CKM_GOSTR3410_KEY_PAIR_GEN if card supports onboard generation

This commit is contained in:
Mathias Brossard 2012-06-25 17:45:19 +02:00
parent 0914b1eca7
commit 3fc4547e45
1 changed files with 11 additions and 0 deletions

View File

@ -4324,6 +4324,17 @@ static int register_gost_mechanisms(struct sc_pkcs11_card *p11card, int flags)
if (rc != CKR_OK)
return rc;
}
if (flags & SC_ALGORITHM_ONBOARD_KEY_GEN) {
mech_info.flags = CKF_HW | CKF_GENERATE_KEY_PAIR;
mt = sc_pkcs11_new_fw_mechanism(CKM_GOSTR3410_KEY_PAIR_GEN,
&mech_info, CKK_GOSTR3410, NULL);
if (!mt)
return CKR_HOST_MEMORY;
rc = sc_pkcs11_register_mechanism(p11card, mt);
if (rc != CKR_OK)
return rc;
}
return CKR_OK;
}