diff options
author | Werner Koch <[email protected]> | 2008-12-05 16:31:39 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2008-12-05 16:31:39 +0000 |
commit | 5bc9948f699b70c76dc0c7c406817d077b61317d (patch) | |
tree | 2c59e77471cbf6f02fea58466c4b5544a9b74cad /g10/call-agent.c | |
parent | Add option --card-timeout. (diff) | |
download | gnupg-5bc9948f699b70c76dc0c7c406817d077b61317d.tar.gz gnupg-5bc9948f699b70c76dc0c7c406817d077b61317d.zip |
Add a custom prompt for the CSR generation.
Add a new percent escape fucntion.
Diffstat (limited to '')
-rw-r--r-- | g10/call-agent.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; |