gnupg/g10 (ChangeLog keyserver.c)
cvs user dshaw
cvs at cvs.gnupg.org
Wed Jan 26 22:11:56 CET 2005
Date: Wednesday, January 26, 2005 @ 22:20:30
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog keyserver.c
* keyserver.c (parse_keyserver_uri): Allow RFC-2732 IPv6 [literal
address] syntax in keyserver URLs. (keyserver_typemap): Map ftps if
we are supporting it.
-------------+
ChangeLog | 6 ++++++
keyserver.c | 40 ++++++++++++++++++++++++++++++++++++----
2 files changed, 42 insertions(+), 4 deletions(-)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.687 gnupg/g10/ChangeLog:1.688
--- gnupg/g10/ChangeLog:1.687 Tue Jan 25 15:34:51 2005
+++ gnupg/g10/ChangeLog Wed Jan 26 22:20:30 2005
@@ -1,3 +1,9 @@
+2005-01-26 David Shaw <dshaw at jabberwocky.com>
+
+ * keyserver.c (parse_keyserver_uri): Allow RFC-2732 IPv6 [literal
+ address] syntax in keyserver URLs.
+ (keyserver_typemap): Map ftps if we are supporting it.
+
2005-01-25 Werner Koch <wk at g10code.com>
* keygen.c (do_generate_keypair): Don't continue after an error;
Index: gnupg/g10/keyserver.c
diff -u gnupg/g10/keyserver.c:1.78 gnupg/g10/keyserver.c:1.79
--- gnupg/g10/keyserver.c:1.78 Sat Jan 22 04:33:12 2005
+++ gnupg/g10/keyserver.c Wed Jan 26 22:20:30 2005
@@ -166,12 +166,26 @@
/* Get the scheme */
for(idx=uri,count=0;*idx && *idx!=':';idx++)
- count++;
+ {
+ count++;
+
+ /* Do we see the start of an RFC-2732 ipv6 address here? If so,
+ there clearly isn't a scheme so get out early. */
+ if(*idx=='[')
+ {
+ /* Was the '[' the first thing in the string? If not, we
+ have a mangled scheme with a [ in it so fail. */
+ if(count==1)
+ break;
+ else
+ goto fail;
+ }
+ }
if(count==0)
goto fail;
- if(*idx=='\0')
+ if(*idx=='\0' || *idx=='[')
{
if(require_scheme)
return NULL;
@@ -237,8 +251,22 @@
uri+=count+1;
}
- for(idx=uri,count=0;*idx && *idx!=':' && *idx!='/';idx++)
- count++;
+ /* Is it an RFC-2732 ipv6 [literal address] ? */
+ if(*uri=='[')
+ {
+ for(idx=uri+1,count=1;*idx
+ && (isxdigit(*idx) || *idx==':' || *idx=='.');idx++)
+ count++;
+
+ /* Is the ipv6 literal address terminated? */
+ if(*idx==']')
+ count++;
+ else
+ goto fail;
+ }
+ else
+ for(idx=uri,count=0;*idx && *idx!=':' && *idx!='/';idx++)
+ count++;
if(count==0)
goto fail;
@@ -790,6 +818,10 @@
else if(strcmp(type,"ftp")==0)
return "curl";
#endif
+#ifdef FTPS_VIA_LIBCURL
+ else if(strcmp(type,"ftps")==0)
+ return "curl";
+#endif
#ifdef HTTP_VIA_LIBCURL
else if(strcmp(type,"http")==0)
return "curl";
More information about the Gnupg-commits
mailing list