mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
agent: Pass comment lines from scd verbatim thru gpg-agent.
* agent/call-scd.c (pass_status_thru): Pass comment lines verbatim. * tools/gpg-connect-agent.c (help_cmd_p): New. (main): Treat an "SCD HELP" the same as "HELP".
This commit is contained in:
parent
2d91febbd8
commit
45cf9de341
13
NEWS
13
NEWS
@ -9,6 +9,19 @@ Noteworthy changes in version 2.1.0beta3
|
|||||||
|
|
||||||
* The Assuan commands KILLAGENT and KILLSCD are working again.
|
* The Assuan commands KILLAGENT and KILLSCD are working again.
|
||||||
|
|
||||||
|
* SCdaemon does not anymore block after changing a card (regression
|
||||||
|
fix).
|
||||||
|
|
||||||
|
* gpg-connect-agent does now proberly display the help output for
|
||||||
|
"SCD HELP" commands.
|
||||||
|
|
||||||
|
* New GPGSM validation model "steed".
|
||||||
|
|
||||||
|
* Improved certificate creation in GPGSM.
|
||||||
|
|
||||||
|
* New option for GPG_AGENT to select a passphrase mode. The loopback
|
||||||
|
mode may be used to bypass Pinentry.
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 2.1.0beta2 (2011-03-08)
|
Noteworthy changes in version 2.1.0beta2 (2011-03-08)
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* call-scd.c - fork of the scdaemon to do SC operations
|
/* call-scd.c - fork of the scdaemon to do SC operations
|
||||||
* Copyright (C) 2001, 2002, 2005, 2007, 2010 Free Software Foundation, Inc.
|
* Copyright (C) 2001, 2002, 2005, 2007, 2010,
|
||||||
|
* 2011 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -1129,16 +1130,28 @@ pass_status_thru (void *opaque, const char *line)
|
|||||||
char keyword[200];
|
char keyword[200];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; *line && !spacep (line) && i < DIM(keyword)-1; line++, i++)
|
if (line[0] == '#' && (!line[1] || spacep (line+1)))
|
||||||
keyword[i] = *line;
|
{
|
||||||
keyword[i] = 0;
|
/* We are called in convey comments mode. Now, if we see a
|
||||||
/* truncate any remaining keyword stuff. */
|
comment marker as keyword we forward the line verbatim to the
|
||||||
for (; *line && !spacep (line); line++)
|
the caller. This way the comment lines from scdaemon won't
|
||||||
;
|
appear as status lines with keyword '#'. */
|
||||||
while (spacep (line))
|
assuan_write_line (ctx, line);
|
||||||
line++;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i=0; *line && !spacep (line) && i < DIM(keyword)-1; line++, i++)
|
||||||
|
keyword[i] = *line;
|
||||||
|
keyword[i] = 0;
|
||||||
|
|
||||||
assuan_write_status (ctx, keyword, line);
|
/* Truncate any remaining keyword stuff. */
|
||||||
|
for (; *line && !spacep (line); line++)
|
||||||
|
;
|
||||||
|
while (spacep (line))
|
||||||
|
line++;
|
||||||
|
|
||||||
|
assuan_write_status (ctx, keyword, line);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1136,6 +1136,22 @@ do_serverpid (assuan_context_t ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Return true if the command is either "HELP" or "SCD HELP". */
|
||||||
|
static int
|
||||||
|
help_cmd_p (const char *line)
|
||||||
|
{
|
||||||
|
if (!ascii_strncasecmp (line, "SCD", 3)
|
||||||
|
&& (spacep (line+3) || !line[3]))
|
||||||
|
{
|
||||||
|
for (line += 3; spacep (line); line++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (!ascii_strncasecmp (line, "HELP", 4)
|
||||||
|
&& (spacep (line+4) || !line[4]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* gpg-connect-agent's entry point. */
|
/* gpg-connect-agent's entry point. */
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
@ -1822,9 +1838,7 @@ main (int argc, char **argv)
|
|||||||
if (*line == '#' || !*line)
|
if (*line == '#' || !*line)
|
||||||
continue; /* Don't expect a response for a comment line. */
|
continue; /* Don't expect a response for a comment line. */
|
||||||
|
|
||||||
rc = read_and_print_response (ctx, (!ascii_strncasecmp (line, "HELP", 4)
|
rc = read_and_print_response (ctx, help_cmd_p (line), &cmderr);
|
||||||
&& (spacep (line+4) || !line[4])),
|
|
||||||
&cmderr);
|
|
||||||
if (rc)
|
if (rc)
|
||||||
log_info (_("receiving line failed: %s\n"), gpg_strerror (rc) );
|
log_info (_("receiving line failed: %s\n"), gpg_strerror (rc) );
|
||||||
if ((rc || cmderr) && script_fp)
|
if ((rc || cmderr) && script_fp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user