diff options
author | Ben Kibbey <[email protected]> | 2011-07-09 12:25:22 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2011-07-27 08:58:52 +0000 |
commit | 29af48840f1f5d39fae8ad7942f3676936134996 (patch) | |
tree | e34f2384feb12cf5649e5e4f1fb35fe18a7cdbbc | |
parent | Fix crash while reading unsupported ssh keys. (diff) | |
download | gnupg-29af48840f1f5d39fae8ad7942f3676936134996.tar.gz gnupg-29af48840f1f5d39fae8ad7942f3676936134996.zip |
Fixed gpg-agent SCD inquire command cancellation.
Need to send the CANCEL command back to scdaemon otherwise the next SCD
command will fail.
-rw-r--r-- | agent/ChangeLog | 5 | ||||
-rw-r--r-- | agent/call-scd.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index e1becac51..25eabbc15 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,8 @@ +2011-07-09 Ben Kibbey <[email protected]> + + * call-scd.c (agent_card_scd): Send the CANCEL command back to SCD + when the SCD command is cancelled from the client. + 2011-07-22 Werner Koch <[email protected]> * command-ssh.c (ssh_receive_key): Do not init comment to an empty diff --git a/agent/call-scd.c b/agent/call-scd.c index 710589f72..1ffb1239e 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -1175,6 +1175,19 @@ agent_card_scd (ctrl_t ctrl, const char *cmdline, pass_data_thru, assuan_context, inq_needpin, &inqparm, pass_status_thru, assuan_context); + if (gpg_err_code(rc) == GPG_ERR_ASS_CANCELED) + { + rc = assuan_write_line(ctrl->scd_local->ctx, "CAN"); + if (!rc) { + char *line; + size_t len; + + rc = assuan_read_line(ctrl->scd_local->ctx, &line, &len); + if (!rc) + rc = gpg_error(GPG_ERR_ASS_CANCELED); + } + } + assuan_set_flag (ctrl->scd_local->ctx, ASSUAN_CONVEY_COMMENTS, saveflag); if (rc) { |