diff options
author | Werner Koch <wk@gnupg.org> | 2009-04-01 12:51:53 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-04-01 12:51:53 +0200 |
commit | f8b4cd76501824d56d3cf78a8ba85291a62f0e6d (patch) | |
tree | cec902ba7d3dd1a38846805cf491a65b95bb79cd /scd | |
parent | Implement decryption for TCOS 3 cards. (diff) | |
download | gnupg2-f8b4cd76501824d56d3cf78a8ba85291a62f0e6d.tar.xz gnupg2-f8b4cd76501824d56d3cf78a8ba85291a62f0e6d.zip |
Import/export of pkcs#12 now uses the gpg-agent directly.
Removed duplicated code (percent unescaping).
Diffstat (limited to 'scd')
-rw-r--r-- | scd/ChangeLog | 5 | ||||
-rw-r--r-- | scd/command.c | 37 |
2 files changed, 6 insertions, 36 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index efd46fea9..534a7092b 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,8 @@ +2009-03-31 Werner Koch <wk@g10code.com> + + * command.c (percent_plus_unescape): Remove. + (cmd_setattr): Use percent_plus_unescape_inplace. + 2009-03-30 Werner Koch <wk@g10code.com> * app-nks.c (do_decipher): Make it work for TCOS 3. 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); |