aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2009-07-08 04:01:13 +0000
committerDavid Shaw <[email protected]>2009-07-08 04:01:13 +0000
commit2e835fd6ab70b7d85cfc90d11baa1cc4cb61a8ef (patch)
tree444e69bd69e43344f1f5a96add13d25c773cedfa
parentImpleemned gpgsm's IMPORT --re-import feature. (diff)
downloadgnupg-2e835fd6ab70b7d85cfc90d11baa1cc4cb61a8ef.tar.gz
gnupg-2e835fd6ab70b7d85cfc90d11baa1cc4cb61a8ef.zip
* 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".
-rw-r--r--keyserver/ChangeLog6
-rw-r--r--keyserver/gpgkeys_hkp.c22
2 files changed, 23 insertions, 5 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index d09152e46..0aeb0a853 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-06 David Shaw <[email protected]>
+
+ * 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 <[email protected]>
* gpgkeys_ldap.c (send_key): Do not deep free a NULL modlist.
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index 2e7f8078a..64a3a7029 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -489,18 +489,21 @@ fail_all(struct keylist *keylist,int err)
/* 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);
@@ -714,17 +717,26 @@ main(int argc,char *argv[])
port=opt->port;
else if(try_srv)
{
+ char *srvtag;
+
+ if(ks_strcasecmp(opt->scheme,"hkp")==0)
+ srvtag="pgpkey-http";
+ else if(ks_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
}