Fix usage indicator for PSS

This commit is contained in:
asc 2018-07-08 15:04:38 +02:00 committed by Frank Morgner
parent 6e0689638c
commit 6f8bfc399b
1 changed files with 4 additions and 0 deletions

View File

@ -5072,6 +5072,9 @@ register_mechanisms(struct sc_pkcs11_card *p11card)
/* TODO support other padding mechanisms */
if (rsa_flags & SC_ALGORITHM_RSA_PAD_PSS) {
CK_FLAGS old_flags = mech_info.flags; // PSS is not available for decryption
mech_info.flags &= ~(CKF_DECRYPT|CKF_VERIFY);
mt = sc_pkcs11_new_fw_mechanism(CKM_RSA_PKCS_PSS, &mech_info, CKK_RSA, NULL, NULL);
rc = sc_pkcs11_register_mechanism(p11card, mt);
if (rc != CKR_OK)
@ -5087,6 +5090,7 @@ register_mechanisms(struct sc_pkcs11_card *p11card)
if (rc != CKR_OK)
return rc;
}
mech_info.flags = old_flags;
}
if (rsa_flags & SC_ALGORITHM_ONBOARD_KEY_GEN) {