Also check for GPG_ERR_ASS_CANCELED during an inquire.
authorBen Kibbey <bjk@luxsci.net>
Wed, 25 Jan 2012 23:14:51 +0000 (18:14 -0500)
committerBen Kibbey <bjk@luxsci.net>
Thu, 26 Jan 2012 00:40:58 +0000 (19:40 -0500)
Fix pinentry-mode=loopback when cancelling an inquire from scdaemon.
This is similar to commit 4f21f8d but for both protocol command
cancellation and pinentry cancellation.

* agent/call-scd.c (agent_card_pkdecrypt): Check for
GPG_ERR_ASS_CANCELED.
(agent_card_pksign): Ditto.

agent/call-scd.c

index ccdb637..f9ededb 100644 (file)
@@ -870,7 +870,8 @@ agent_card_pksign (ctrl_t ctrl,
                         membuf_data_cb, &data,
                         inq_needpin, &inqparm,
                         NULL, NULL);
-  if (inqparm.any_inq_seen && gpg_err_code(rc) == GPG_ERR_CANCELED)
+  if (inqparm.any_inq_seen && (gpg_err_code(rc) == GPG_ERR_CANCELED ||
+       gpg_err_code(rc) == GPG_ERR_ASS_CANCELED))
     rc = cancel_inquire (ctrl, rc);
 
   if (rc)
@@ -949,7 +950,8 @@ agent_card_pkdecrypt (ctrl_t ctrl,
                         membuf_data_cb, &data,
                         inq_needpin, &inqparm,
                         NULL, NULL);
-  if (inqparm.any_inq_seen && gpg_err_code(rc) == GPG_ERR_CANCELED)
+  if (inqparm.any_inq_seen && (gpg_err_code(rc) == GPG_ERR_CANCELED ||
+       gpg_err_code(rc) == GPG_ERR_ASS_CANCELED))
     rc = cancel_inquire (ctrl, rc);
 
   if (rc)