scd:yubikey: Fix support of Yubikey NEO.

* scd/app-openpgp.c (get_public_key): Yubikey NEO also has this issue.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-12-08 17:45:18 +09:00
parent eda3c688fc
commit 946555ea3c
1 changed files with 3 additions and 0 deletions

View File

@ -1920,6 +1920,9 @@ get_public_key (app_t app, int keyno)
/* Yubikey returns wrong code. Fix it up. */
if (app->card->cardtype == CARDTYPE_YUBIKEY)
err = gpg_error (GPG_ERR_NO_OBJ);
/* Yubikey NEO (!CARDTYPE_YUBIKEY) also returns wrong code. Fix it up. */
else if (gpg_err_code (err) == GPG_ERR_CARD)
err = gpg_error (GPG_ERR_NO_OBJ);
log_error (_("reading public key failed: %s\n"), gpg_strerror (err));
goto leave;
}