From 0b45e78e4fd983e68f9073944d8a2bd82d84a3bb Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 17 May 2021 16:20:49 +0200 Subject: [PATCH] idprime: Fix RSA-PKCS mechanism with hashing on card --- src/libopensc/card-idprime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libopensc/card-idprime.c b/src/libopensc/card-idprime.c index 232d725f..68d963ec 100644 --- a/src/libopensc/card-idprime.c +++ b/src/libopensc/card-idprime.c @@ -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;