summaryrefslogtreecommitdiffstats
path: root/agent/divert-scd.c
diff options
context:
space:
mode:
authorBen Kibbey <bjk@luxsci.net>2012-01-26 01:16:33 +0100
committerBen Kibbey <bjk@luxsci.net>2012-01-26 01:41:05 +0100
commitcf748e8736b984194345bfd74887b35d3d23fa37 (patch)
treebdc1a6270a09070d5f9a861a5779af0cac51747a /agent/divert-scd.c
parentAlso check for GPG_ERR_ASS_CANCELED during an inquire. (diff)
downloadgnupg2-cf748e8736b984194345bfd74887b35d3d23fa37.tar.xz
gnupg2-cf748e8736b984194345bfd74887b35d3d23fa37.zip
Return GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.
Since there isn't a way to prompt the user to insert the smartcard when pinentry-mode=loopback, return GPG_ERR_CARD_NOT_PRESENT instead of GPG_ERR_NO_PIN_ENTRY. * agent/divert-scd.c (ask_for_card): Return GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.
Diffstat (limited to '')
-rw-r--r--agent/divert-scd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index f176a6b94..59264243d 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -99,6 +99,10 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid)
else
{
rc = agent_get_confirmation (ctrl, desc, NULL, NULL, 0);
+ if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK &&
+ gpg_err_code (rc) == GPG_ERR_NO_PIN_ENTRY)
+ rc = gpg_error (GPG_ERR_CARD_NOT_PRESENT);
+
xfree (desc);
}
}