scd: Add a workaround for Yubikey.

* scd/app-openpgp.c (get_public_key): Handle wrong code for Yubikey.

--

Backport master commit of:

	0db9c83555

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 <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-09-08 11:41:33 +09:00
parent 0f4c956a76
commit 25bec16d0b
1 changed files with 6 additions and 0 deletions

View File

@ -1756,6 +1756,12 @@ get_public_key (app_t app, int keyno)
2, le_value, &buffer, &buflen);
if (err)
{
/* Yubikey returns wrong code. Fix it up. */
/*
* NOTE: It's not correct to blindly change the error code,
* however, for our experiences, it is only Yubikey...
*/
err = gpg_error (GPG_ERR_NO_OBJ);
log_error (_("reading public key failed: %s\n"), gpg_strerror (err));
goto leave;
}