gnupg/g10 (ChangeLog keyserver.c options.h)
cvs user dshaw
cvs at cvs.gnupg.org
Wed Dec 22 19:04:36 CET 2004
Date: Wednesday, December 22, 2004 @ 19:09:41
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog keyserver.c options.h
* options.h, keyserver.c (parse_keyserver_uri): Properly parse auth data
from URLs and pass to keyserver helpers.
-------------+
ChangeLog | 3 +++
keyserver.c | 20 ++++++++++++++++++++
options.h | 1 +
3 files changed, 24 insertions(+)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.670 gnupg/g10/ChangeLog:1.671
--- gnupg/g10/ChangeLog:1.670 Wed Dec 22 18:49:44 2004
+++ gnupg/g10/ChangeLog Wed Dec 22 19:09:41 2004
@@ -1,5 +1,8 @@
2004-12-22 David Shaw <dshaw at jabberwocky.com>
+ * options.h, keyserver.c (parse_keyserver_uri): Properly parse
+ auth data from URLs and pass to keyserver helpers.
+
* keyserver.c (keyserver_typemap): New. Map certain keyserver
types to a common type (e.g. ldaps -> ldap). If we are building
with curl, map both http and ftp to curl.
Index: gnupg/g10/keyserver.c
diff -u gnupg/g10/keyserver.c:1.74 gnupg/g10/keyserver.c:1.75
--- gnupg/g10/keyserver.c:1.74 Wed Dec 22 18:49:44 2004
+++ gnupg/g10/keyserver.c Wed Dec 22 19:09:41 2004
@@ -218,6 +218,23 @@
if(!assume_hkp)
uri+=2;
+ /* Do we have userinfo auth data present? */
+ for(idx=uri,count=0;*idx && *idx!='@' && *idx!='/';idx++)
+ count++;
+
+ /* We found a @ before the slash, so that means everything
+ before the @ is auth data. */
+ if(*idx=='@')
+ {
+ if(count==0)
+ goto fail;
+
+ keyserver->auth=m_alloc(count+1);
+ strncpy(keyserver->auth,uri,count);
+ keyserver->auth[count]='\0';
+ uri+=count+1;
+ }
+
for(idx=uri,count=0;*idx && *idx!=':' && *idx!='/';idx++)
count++;
@@ -846,6 +863,9 @@
fprintf(spawn->tochild,"OPAQUE %s\n",keyserver->opaque);
else
{
+ if(keyserver->auth)
+ fprintf(spawn->tochild,"AUTH %s\n",keyserver->auth);
+
if(keyserver->host)
fprintf(spawn->tochild,"HOST %s\n",keyserver->host);
Index: gnupg/g10/options.h
diff -u gnupg/g10/options.h:1.131 gnupg/g10/options.h:1.132
--- gnupg/g10/options.h:1.131 Mon Dec 20 06:19:09 2004
+++ gnupg/g10/options.h Wed Dec 22 19:09:41 2004
@@ -129,6 +129,7 @@
{
char *uri;
char *scheme;
+ char *auth;
char *host;
char *port;
char *path;
More information about the Gnupg-commits
mailing list