Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34158079
02-extern-umlaute.patch
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
02-extern-umlaute.patch
View Options
#! /bin/sh
patch -p0 -f $* < $0
exit $?
2008-10-23 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (gpg_keylist_preprocess): Convert percent escaped
string to C coded string.
Index: gpgme/rungpg.c
===================================================================
--- gpgme/rungpg.c (revision 1336)
+++ gpgme/rungpg.c (working copy)
@@ -1878,12 +1878,47 @@
HTTP Keyserver Protocol (draft).
We want:
- uid:o<flags>::::<creatdate>:<expdate>:::<uid>:
+ uid:o<flags>::::<creatdate>:<expdate>:::<c-coded uid>:
*/
- if (asprintf (r_line, "uid:o%s::::%s:%s:::%s:",
- field[4], field[2], field[3], field[1]) < 0)
- return gpg_error_from_errno (errno);
+ {
+ /* The user ID is percent escaped, but we want c-coded.
+ Because we have to replace each '%HL' by '\xHL', we need at
+ most 4/3 th the number of bytes. But because this
+ security software, we err on the good side and allocate
+ twice as much. */
+ char *uid = malloc (2 * strlen (field[1]) + 1);
+ char *src;
+ char *dst;
+
+ if (! uid)
+ return gpg_error_from_errno (errno);
+ src = field[1];
+ dst = uid;
+ while (*src)
+ {
+ if (*src == '%')
+ {
+ *(dst++) = '\\';
+ *(dst++) = 'x';
+ src++;
+ /* Copy the next two bytes unconditionally. This is
+ what reduces the maximum number of needed bytes
+ from 2n+1 to (4/3)n+1, even for invalid strings. */
+ if (*src)
+ *(dst++) = *(src++);
+ if (*src)
+ *(dst++) = *(src++);
+ }
+ else
+ *(dst++) = *(src++);
+ }
+ *dst = '\0';
+
+ if (asprintf (r_line, "uid:o%s::::%s:%s:::%s:",
+ field[4], field[2], field[3], uid) < 0)
+ return gpg_error_from_errno (errno);
+ }
return 0;
case RT_NONE:
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Thu, Dec 11, 8:10 AM (6 h, 43 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cd/ff/a8d4bf0cdd04f4024a4321b2d81a
Attached To
rW Gpg4win
Event Timeline
Log In to Comment