pkcs11: Make sure a key can be used for a given signature scheme.

This commit is contained in:
Tobias Brunner
2011-11-02 20:27:55 +01:00
parent 58d0a8d49b
commit 5b85b94e27
3 changed files with 31 additions and 16 deletions
@@ -207,7 +207,8 @@ METHOD(public_key_t, verify, bool,
hash_algorithm_t hash_alg;
chunk_t hash = chunk_empty;
mechanism = pkcs11_signature_scheme_to_mech(scheme, &hash_alg);
mechanism = pkcs11_signature_scheme_to_mech(scheme, this->type, this->k,
&hash_alg);
if (!mechanism)
{
DBG1(DBG_LIB, "signature scheme %N not supported",