aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-12-05 16:31:39 +0000
committerWerner Koch <[email protected]>2008-12-05 16:31:39 +0000
commit5bc9948f699b70c76dc0c7c406817d077b61317d (patch)
tree2c59e77471cbf6f02fea58466c4b5544a9b74cad /g10
parentAdd option --card-timeout. (diff)
downloadgnupg-5bc9948f699b70c76dc0c7c406817d077b61317d.tar.gz
gnupg-5bc9948f699b70c76dc0c7c406817d077b61317d.zip
Add a custom prompt for the CSR generation.
Add a new percent escape fucntion.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/call-agent.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index eec3d6f0b..0ad19abaf 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-05 Werner Koch <[email protected]>
+
+ * call-agent.c (percent_plus_escape): Rename to
+ my_percent_plus_escape and also escape the percent character.
+ Change all callers.
+
2008-11-18 Werner Koch <[email protected]>
* gpg.c (build_lib_list): Remove.
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 15c17b038..33025ef27 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -148,15 +148,15 @@ unescape_status_string (const unsigned char *s)
escaping. Note that the provided buffer needs to be 3 times the
size of ATEXT plus 1. Returns a pointer to the leading Nul in P. */
static char *
-percent_plus_escape (char *p, const char *atext)
+my_percent_plus_escape (char *p, const char *atext)
{
const unsigned char *s;
for (s=atext; *s; s++)
{
- if (*s < ' ' || *s == '+')
+ if (*s < ' ' || *s == '+' || *s == '%')
{
- sprintf (p, "%%%02X", *s);
+ snprintf (p, 4, "%%%02X", *s);
p += 3;
}
else if (*s == ' ')
@@ -865,25 +865,25 @@ agent_get_passphrase (const char *cache_id,
p = stpcpy (line, cmd);
if (cache_id && *cache_id)
- p = percent_plus_escape (p, cache_id);
+ p = my_percent_plus_escape (p, cache_id);
else
*p++ = 'X';
*p++ = ' ';
if (err_msg && *err_msg)
- p = percent_plus_escape (p, err_msg);
+ p = my_percent_plus_escape (p, err_msg);
else
*p++ = 'X';
*p++ = ' ';
if (prompt && *prompt)
- p = percent_plus_escape (p, prompt);
+ p = my_percent_plus_escape (p, prompt);
else
*p++ = 'X';
*p++ = ' ';
if (desc_msg && *desc_msg)
- p = percent_plus_escape (p, desc_msg);
+ p = my_percent_plus_escape (p, desc_msg);
else
*p++ = 'X';
*p = 0;