1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

Quote and unquote backslashes from keyserver search responses.

This commit is contained in:
David Shaw 2002-03-29 16:58:07 +00:00
parent 47c8a325f5
commit 9fb6cae5e4
3 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2002-03-29 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (printunquoted): unquote backslashes from keyserver
searches
* hkp.c (write_quoted): quote backslashes from keyserver searches
2002-03-23 David Shaw <dshaw@jabberwocky.com> 2002-03-23 David Shaw <dshaw@jabberwocky.com>
* import.c (append_uid, merge_sigs): it is okay to import * import.c (append_uid, merge_sigs): it is okay to import

View File

@ -234,6 +234,11 @@ write_quoted(IOBUF a, const char *buf, char delim)
if(iobuf_writestr(a,quoted)) if(iobuf_writestr(a,quoted))
return -1; return -1;
} }
else if(*buf=='\\')
{
if(iobuf_writestr(a,"\\x5c"))
return -1;
}
else else
{ {
if(iobuf_writebyte(a,*buf)) if(iobuf_writebyte(a,*buf))

View File

@ -152,7 +152,7 @@ parse_keyserver_uri(char *uri)
return 0; return 0;
} }
/* Unquote only the delimiter character */ /* Unquote only the delimiter character and backslash */
static void static void
printunquoted(char *string,char delim) printunquoted(char *string,char delim)
{ {
@ -164,12 +164,17 @@ printunquoted(char *string,char delim)
{ {
int c; int c;
sscanf(ch,"\\x%02X",&c); sscanf(ch,"\\x%02x",&c);
if(c==delim) if(c==delim)
{ {
printf("%c",c); printf("%c",c);
ch+=3; ch+=3;
} }
else if(c=='\\')
{
fputc('\\',stdout);
ch+=3;
}
else else
fputc(*ch,stdout); fputc(*ch,stdout);
} }