diff options
author | Werner Koch <[email protected]> | 2009-04-01 10:51:53 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2009-04-01 10:51:53 +0000 |
commit | f8b4cd76501824d56d3cf78a8ba85291a62f0e6d (patch) | |
tree | cec902ba7d3dd1a38846805cf491a65b95bb79cd /scd/command.c | |
parent | Implement decryption for TCOS 3 cards. (diff) | |
download | gnupg-f8b4cd76501824d56d3cf78a8ba85291a62f0e6d.tar.gz gnupg-f8b4cd76501824d56d3cf78a8ba85291a62f0e6d.zip |
Import/export of pkcs#12 now uses the gpg-agent directly.
Removed duplicated code (percent unescaping).
Diffstat (limited to '')
-rw-r--r-- | scd/command.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/scd/command.c b/scd/command.c index 71081b26f..6c1cdd072 100644 --- a/scd/command.c +++ b/scd/command.c @@ -462,41 +462,6 @@ open_card (ctrl_t ctrl, const char *apptype) } -/* Do the percent and plus/space unescaping in place and return the - length of the valid buffer. */ -static size_t -percent_plus_unescape (unsigned char *string) -{ - unsigned char *p = string; - size_t n = 0; - - while (*string) - { - if (*string == '%' && string[1] && string[2]) - { - string++; - *p++ = xtoi_2 (string); - n++; - string+= 2; - } - else if (*string == '+') - { - *p++ = ' '; - n++; - string++; - } - else - { - *p++ = *string++; - n++; - } - } - - return n; -} - - - /* SERIALNO [APPTYPE] Return the serial number of the card using a status reponse. This @@ -1153,7 +1118,7 @@ cmd_setattr (assuan_context_t ctx, char *orig_line) *line++ = 0; while (spacep (line)) line++; - nbytes = percent_plus_unescape ((unsigned char*)line); + nbytes = percent_plus_unescape_inplace (line, 0); rc = app_setattr (ctrl->app_ctx, keyword, pin_cb, ctx, (const unsigned char*)line, nbytes); |