idprime: Fix RSA-PKCS mechanism with hashing on card

This commit is contained in:
Jakub Jelen 2021-05-17 16:20:49 +02:00 committed by Jakub Jelen
parent fc08818f6f
commit 0b45e78e4f
1 changed files with 3 additions and 3 deletions

View File

@ -664,11 +664,11 @@ idprime_set_security_env(struct sc_card *card,
new_env.algorithm_ref = 0x65;
}
} else { /* RSA-PKCS */
if (env->algorithm_flags & SC_ALGORITHM_MGF1_SHA256) {
if (env->algorithm_flags & SC_ALGORITHM_RSA_HASH_SHA256) {
new_env.algorithm_ref = 0x42;
} else if (env->algorithm_flags & SC_ALGORITHM_MGF1_SHA384) {
} else if (env->algorithm_flags & SC_ALGORITHM_RSA_HASH_SHA384) {
new_env.algorithm_ref = 0x52;
} else if (env->algorithm_flags & SC_ALGORITHM_MGF1_SHA512) {
} else if (env->algorithm_flags & SC_ALGORITHM_RSA_HASH_SHA512) {
new_env.algorithm_ref = 0x62;
} else { /* RSA-PKCS without hashing */
new_env.algorithm_ref = 0x02;