aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-03-29 16:58:07 +0000
committerDavid Shaw <[email protected]>2002-03-29 16:58:07 +0000
commit9fb6cae5e404706a219e7d0cd5d30348686d8132 (patch)
tree5b3da411787e71cb48794696a83c6b06c083a95a
parentIf a delimiter is used, then quote the backslash character as well. (diff)
downloadgnupg-9fb6cae5e404706a219e7d0cd5d30348686d8132.tar.gz
gnupg-9fb6cae5e404706a219e7d0cd5d30348686d8132.zip
Quote and unquote backslashes from keyserver search responses.
-rw-r--r--g10/ChangeLog7
-rw-r--r--g10/hkp.c5
-rw-r--r--g10/keyserver.c9
3 files changed, 19 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index a170c915d..1e72d2a0d 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-29 David Shaw <[email protected]>
+
+ * keyserver.c (printunquoted): unquote backslashes from keyserver
+ searches
+
+ * hkp.c (write_quoted): quote backslashes from keyserver searches
+
2002-03-23 David Shaw <[email protected]>
* import.c (append_uid, merge_sigs): it is okay to import
diff --git a/g10/hkp.c b/g10/hkp.c
index 62568f70f..3a7b654f6 100644
--- a/g10/hkp.c
+++ b/g10/hkp.c
@@ -234,6 +234,11 @@ write_quoted(IOBUF a, const char *buf, char delim)
if(iobuf_writestr(a,quoted))
return -1;
}
+ else if(*buf=='\\')
+ {
+ if(iobuf_writestr(a,"\\x5c"))
+ return -1;
+ }
else
{
if(iobuf_writebyte(a,*buf))
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 717c8643e..d5a65526e 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -152,7 +152,7 @@ parse_keyserver_uri(char *uri)
return 0;
}
-/* Unquote only the delimiter character */
+/* Unquote only the delimiter character and backslash */
static void
printunquoted(char *string,char delim)
{
@@ -164,12 +164,17 @@ printunquoted(char *string,char delim)
{
int c;
- sscanf(ch,"\\x%02X",&c);
+ sscanf(ch,"\\x%02x",&c);
if(c==delim)
{
printf("%c",c);
ch+=3;
}
+ else if(c=='\\')
+ {
+ fputc('\\',stdout);
+ ch+=3;
+ }
else
fputc(*ch,stdout);
}