openpgp: Unbreak EC algorithms for GNUK

Since 09a594d bringing ECC support to openPGP card, it did not count
with GNUK. This adds exception for GNUK to unbreak ECC signatures
as GNUK presents BCD version < 3.
This commit is contained in:
Jakub Jelen 2020-02-25 10:40:59 +01:00
parent a965829f52
commit e7d390f9dd
1 changed files with 3 additions and 1 deletions

View File

@ -2067,9 +2067,11 @@ pgp_set_security_env(sc_card_t *card,
LOG_FUNC_CALLED(card->ctx);
/* The SC_SEC_ENV_ALG_PRESENT is set always so let it pass for GNUK */
if ((env->flags & SC_SEC_ENV_ALG_PRESENT)
&& (env->algorithm != SC_ALGORITHM_RSA)
&& (priv->bcd_version < OPENPGP_CARD_3_0))
&& (priv->bcd_version < OPENPGP_CARD_3_0)
&& (card->type != SC_CARD_TYPE_OPENPGP_GNUK))
LOG_TEST_RET(card->ctx, SC_ERROR_INVALID_ARGUMENTS,
"only RSA algorithm supported");