1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-04 20:38:50 +01:00

Pass on comment lines from scdaemon.

This commit is contained in:
Werner Koch 2010-08-11 13:06:35 +00:00
parent cc1bd779f6
commit 6628b56e46
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2010-08-11 Werner Koch <wk@g10code.com>
* call-scd.c (agent_card_scd): Pass assuan comment lines to the
caller.
(ASSUAN_CONVEY_COMMENTS): Provide replacement if needed.
2010-05-12 Werner Koch <wk@g10code.com> 2010-05-12 Werner Koch <wk@g10code.com>
* preset-passphrase.c (forget_passphrase): Actually implement * preset-passphrase.c (forget_passphrase): Actually implement

View File

@ -42,6 +42,15 @@
#define MAX_OPEN_FDS 20 #define MAX_OPEN_FDS 20
#endif #endif
/* This Assuan flag is only available since libassuan 2.0.2. Because
comments lines are comments anyway we can use a replacement which
might not do anything. assuan_{g,s}et_flag don't return an error
thus there won't be any ABI problem. */
#ifndef ASSUAN_CONVEY_COMMENTS
#define ASSUAN_CONVEY_COMMENTS 4
#endif
/* Definition of module local data of the CTRL structure. */ /* Definition of module local data of the CTRL structure. */
struct scd_local_s struct scd_local_s
{ {
@ -1129,6 +1138,7 @@ agent_card_scd (ctrl_t ctrl, const char *cmdline,
{ {
int rc; int rc;
struct inq_needpin_s inqparm; struct inq_needpin_s inqparm;
int saveflag;
rc = start_scd (ctrl); rc = start_scd (ctrl);
if (rc) if (rc)
@ -1138,10 +1148,13 @@ agent_card_scd (ctrl_t ctrl, const char *cmdline,
inqparm.getpin_cb = getpin_cb; inqparm.getpin_cb = getpin_cb;
inqparm.getpin_cb_arg = getpin_cb_arg; inqparm.getpin_cb_arg = getpin_cb_arg;
inqparm.passthru = assuan_context; inqparm.passthru = assuan_context;
saveflag = assuan_get_flag (ctrl->scd_local->ctx, ASSUAN_CONVEY_COMMENTS);
assuan_set_flag (ctrl->scd_local->ctx, ASSUAN_CONVEY_COMMENTS, 1);
rc = assuan_transact (ctrl->scd_local->ctx, cmdline, rc = assuan_transact (ctrl->scd_local->ctx, cmdline,
pass_data_thru, assuan_context, pass_data_thru, assuan_context,
inq_needpin, &inqparm, inq_needpin, &inqparm,
pass_status_thru, assuan_context); pass_status_thru, assuan_context);
assuan_set_flag (ctrl->scd_local->ctx, ASSUAN_CONVEY_COMMENTS, saveflag);
if (rc) if (rc)
{ {
return unlock_scd (ctrl, rc); return unlock_scd (ctrl, rc);