Fix 2340 pkcs15-sec.c wrong test

if (obj->type == SC_PKCS15_TYPE_PRKEY_RSA) { is the correct test.
This commit is contained in:
Doug Engert 2021-05-15 13:41:36 -05:00 committed by Jakub Jelen
parent 5256bc3d3d
commit 8dfafe4fc2
1 changed files with 1 additions and 1 deletions

View File

@ -635,7 +635,7 @@ int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card,
* key is for signing and decryption, we need to emulate signing */
sc_log(ctx, "supported algorithm flags 0x%X, private key usage 0x%X", alg_info->flags, prkey->usage);
if (obj->type == SC_ALGORITHM_RSA) {
if (obj->type == SC_PKCS15_TYPE_PRKEY_RSA) {
if ((alg_info->flags & SC_ALGORITHM_NEED_USAGE) &&
((prkey->usage & USAGE_ANY_SIGN) &&
(prkey->usage & USAGE_ANY_DECIPHER)) ) {