summaryrefslogtreecommitdiffstats
path: root/keyserver
diff options
context:
space:
mode:
authorDavid Shaw <dshaw@jabberwocky.com>2002-09-16 16:35:19 +0200
committerDavid Shaw <dshaw@jabberwocky.com>2002-09-16 16:35:19 +0200
commit81c8f7daca6d0776c15db65500e765fabac587b4 (patch)
treec016f862571a45d13d9e49e48fa3b39e98a5d4b0 /keyserver
parent* gpg.sgml: Add rebuild-keydb-caches. (diff)
downloadgnupg2-81c8f7daca6d0776c15db65500e765fabac587b4.tar.xz
gnupg2-81c8f7daca6d0776c15db65500e765fabac587b4.zip
* gpgkeys_mailto.in: Add quasi-RFC-2368 mailto:email@addr?from= syntax so
people can set their own email address to respond to. * gpgkeys_hkp.c (get_key): Properly respond with KEY FAILED (to gpg) and "key not found" (to user) on failure.
Diffstat (limited to 'keyserver')
-rw-r--r--keyserver/ChangeLog8
-rw-r--r--keyserver/gpgkeys_hkp.c14
-rwxr-xr-xkeyserver/gpgkeys_mailto.in27
3 files changed, 43 insertions, 6 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index 299f95a6f..f8e39faab 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,11 @@
+2002-09-16 David Shaw <dshaw@jabberwocky.com>
+
+ * gpgkeys_mailto.in: Add quasi-RFC-2368 mailto:email@addr?from=
+ syntax so people can set their own email address to respond to.
+
+ * gpgkeys_hkp.c (get_key): Properly respond with KEY FAILED (to
+ gpg) and "key not found" (to user) on failure.
+
2002-09-13 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_hkp.c: (search_key, handle_old_hkp_index): Try and
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index da4ce61fe..f324267c9 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -261,11 +261,7 @@ get_key(char *getkey)
{
fprintf(output,line);
if(strcmp(line,"-----END PGP PUBLIC KEY BLOCK-----\n")==0)
- {
- gotit=0;
- fprintf(output,"KEY 0x%s END\n",getkey);
- break;
- }
+ break;
}
else
if(strcmp(line,"-----BEGIN PGP PUBLIC KEY BLOCK-----\n")==0)
@@ -274,6 +270,14 @@ get_key(char *getkey)
gotit=1;
}
}
+
+ if(gotit)
+ fprintf(output,"KEY 0x%s END\n",getkey);
+ else
+ {
+ fprintf(console,"gpgkeys: key %s not found on keyserver\n",getkey);
+ fprintf(output,"KEY 0x%s FAILED\n",getkey);
+ }
}
m_free(line);
diff --git a/keyserver/gpgkeys_mailto.in b/keyserver/gpgkeys_mailto.in
index d2bde094d..9086de419 100755
--- a/keyserver/gpgkeys_mailto.in
+++ b/keyserver/gpgkeys_mailto.in
@@ -38,6 +38,8 @@ if(@ARGV)
($login,$name)=(getpwuid($<))[0,6];
+$from="$name <$login>";
+
while(<STDIN>)
{
last if($_ eq "\n");
@@ -78,6 +80,29 @@ if(!defined($address))
exit(1);
}
+# decode $address
+
+($address,$args)=split(/\?/,$address);
+
+if(defined($args))
+{
+ @pairs = split(/&/, $args);
+ foreach $pair (@pairs)
+ {
+ ($hdr, $val) = split(/=/, $pair);
+ $hdr =~ tr/+/ /;
+ $hdr =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+ $val =~ tr/+/ /;
+ $val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+# we only handle "from" right now
+ if($hdr=~/^from$/i)
+ {
+ $from=$val;
+ last;
+ }
+ }
+}
+
while(<STDIN>)
{
last if($_ eq "\n");
@@ -104,7 +129,7 @@ if($command=~/get/i || $command=~/search/i)
foreach $key (@keys)
{
open(MAIL,"|$sendmail") || die "ERROR: Can't open $sendmail\n";
- print MAIL "From: $name <$login>\n";
+ print MAIL "From: $from\n";
print MAIL "To: $address\n";
if($command=~/get/i)
{