[svn] GnuPG - r5068 - branches/STABLE-BRANCH-1-4/keyserver

svn author dshaw cvs at cvs.gnupg.org
Wed Jul 8 05:50:27 CEST 2009


Author: dshaw
Date: 2009-07-08 05:50:26 +0200 (Wed, 08 Jul 2009)
New Revision: 5068

Modified:
   branches/STABLE-BRANCH-1-4/keyserver/ChangeLog
   branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c
Log:
* gpgkeys_hkp.c (main, srv_replace): Minor tweaks to use the DNS-SD
names ("pgpkey-http" and "pgpkey-https") in SRV lookups instead of
"hkp" and "hkps".


Modified: branches/STABLE-BRANCH-1-4/keyserver/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/keyserver/ChangeLog	2009-07-07 16:52:12 UTC (rev 5067)
+++ branches/STABLE-BRANCH-1-4/keyserver/ChangeLog	2009-07-08 03:50:26 UTC (rev 5068)
@@ -1,3 +1,9 @@
+2009-07-06  David Shaw  <dshaw at jabberwocky.com>
+
+	* gpgkeys_hkp.c (main, srv_replace): Minor tweaks to use the
+	DNS-SD names ("pgpkey-http" and "pgpkey-https") in SRV lookups
+	instead of "hkp" and "hkps".
+
 2009-06-24  Werner Koch  <wk at g10code.com>
 
 	* gpgkeys_ldap.c (send_key): Do not loop over a NULL modlist in

Modified: branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c
===================================================================
--- branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c	2009-07-07 16:52:12 UTC (rev 5067)
+++ branches/STABLE-BRANCH-1-4/keyserver/gpgkeys_hkp.c	2009-07-08 03:50:26 UTC (rev 5068)
@@ -494,18 +494,21 @@
 /* If there is a SRV record, take the highest ranked possibility.
    This is a hack, as we don't proceed downwards. */
 static void
-srv_replace(void)
+srv_replace(const char *srvtag)
 {
 #ifdef USE_DNS_SRV
   struct srventry *srvlist=NULL;
   int srvcount;
 
-  if(1+strlen(opt->scheme)+6+strlen(opt->host)+1<=MAXDNAME)
+  if(!srvtag)
+    return;
+
+  if(1+strlen(srvtag)+6+strlen(opt->host)+1<=MAXDNAME)
     {
       char srvname[MAXDNAME];
 
       strcpy(srvname,"_");
-      strcat(srvname,opt->scheme);
+      strcat(srvname,srvtag);
       strcat(srvname,"._tcp.");
       strcat(srvname,opt->host);
       srvcount=getsrv(srvname,&srvlist);
@@ -720,17 +723,26 @@
     port=opt->port;
   else if(try_srv)
     {
+      char *srvtag;
+
+      if(ascii_strcasecmp(opt->scheme,"hkp")==0)
+	srvtag="pgpkey-http";
+      else if(ascii_strcasecmp(opt->scheme,"hkps")==0)
+	srvtag="pgpkey-https";
+      else
+	srvtag=NULL;
+
 #ifdef HAVE_LIBCURL
       /* We're using libcurl, so fake SRV support via our wrapper.
 	 This isn't as good as true SRV support, as we do not try all
 	 possible targets at one particular level and work our way
 	 down the list, but it's better than nothing. */
-      srv_replace();
+      srv_replace(srvtag);
 #else
       /* We're using our internal curl shim, so we can use its (true)
 	 SRV support.  Obviously, CURLOPT_SRVTAG_GPG_HACK isn't a real
 	 libcurl option.  It's specific to our shim. */
-      curl_easy_setopt(curl,CURLOPT_SRVTAG_GPG_HACK,opt->scheme);
+      curl_easy_setopt(curl,CURLOPT_SRVTAG_GPG_HACK,srvtag);
 #endif
     }
 




More information about the Gnupg-commits mailing list