aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2020-09-08 02:41:33 +0000
committerNIIBE Yutaka <[email protected]>2020-09-08 02:41:33 +0000
commit0db9c83555b4a8a0c52f96e96ec20dbfd3d75272 (patch)
tree912a784df2de5a4a79da31f08b367cf2f54b8adf /scd/app-openpgp.c
parentscd: Fix handling 0x00FA to support OpenPGP card 3.4. (diff)
downloadgnupg-0db9c83555b4a8a0c52f96e96ec20dbfd3d75272.tar.gz
gnupg-0db9c83555b4a8a0c52f96e96ec20dbfd3d75272.zip
scd: Add a workaround for Yubikey.
* scd/app-openpgp.c (get_public_key): Handle wrong code for Yubikey. -- Yubikey version 5 s/n 609074582 returns 0x6982, version 5.2.4 s/n 610616049 returns 0x6581, where 0x6a88 is expected. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 874fc0db2..d434e341d 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1943,6 +1943,9 @@ get_public_key (app_t app, int keyno)
2, le_value, &buffer, &buflen);
if (err)
{
+ /* Yubikey returns wrong code. Fix it up. */
+ if (app->card->cardtype == CARDTYPE_YUBIKEY)
+ err = gpg_error (GPG_ERR_NO_OBJ);
log_error (_("reading public key failed: %s\n"), gpg_strerror (err));
goto leave;
}