From 0db9c83555b4a8a0c52f96e96ec20dbfd3d75272 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 8 Sep 2020 11:41:33 +0900 Subject: [PATCH] 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 --- scd/app-openpgp.c | 3 +++ 1 file changed, 3 insertions(+) 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; }