mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-04 20:38:50 +01:00
* 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.
This commit is contained in:
parent
8d8e90b52d
commit
62760da457
@ -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-09 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* gpgkeys_hkp.c (send_key, get_key, search_key): Check return
|
||||
|
@ -255,11 +255,7 @@ int 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)
|
||||
@ -268,6 +264,14 @@ int 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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user