mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
scd:openpgp: Handle wrong error return code of Yubikey.
* scd/app-openpgp.c (get_public_key): Handle wrong error code by Yubikeys. -- This has been taken from commits 0db9c83555b4a8a0c52f96e96ec20dbfd3d75272 946555ea3ceb823b95ed13654ae4fd667daa4337
This commit is contained in:
parent
d938abcc5e
commit
d25e960652
@ -1887,11 +1887,12 @@ get_public_key (app_t app, int keyno)
|
||||
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);
|
||||
if (APP_CARD(app)->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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user