summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-07-02 18:03:55 +0000
committerPeter Palfrader <peter@palfrader.org>2002-07-02 18:03:55 +0000
commitbcb4b53f7c2aec7062fac9f468496381a257ad82 (patch)
tree0cb2a6507df952e4788c78d35a726f8d6c20d660
parent6319ed28454066f9530ab9c758ce85faedb6d6f9 (diff)
ping cpunk without pgponly in clear too
-rw-r--r--Echolot/Conf.pm25
-rw-r--r--Echolot/Pinger.pm15
-rw-r--r--Echolot/Pinger/CPunk.pm21
-rw-r--r--Echolot/Stats.pm4
-rw-r--r--TODO1
5 files changed, 44 insertions, 22 deletions
diff --git a/Echolot/Conf.pm b/Echolot/Conf.pm
index 76b8aa0..6e8a6fd 100644
--- a/Echolot/Conf.pm
+++ b/Echolot/Conf.pm
@@ -1,7 +1,7 @@
package Echolot::Conf;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Conf.pm,v 1.8 2002/07/02 17:06:59 weasel Exp $
+# $Id: Conf.pm,v 1.9 2002/07/02 18:03:55 weasel Exp $
#
=pod
@@ -29,7 +29,8 @@ sub send_requests() {
for my $remailer (Echolot::Globals::get()->{'storage'}->get_addresses()) {
next unless ($remailer->{'status'} eq 'active');
next unless ($remailer->{'fetch'});
- print "Sending requests to ".$remailer->{'address'}."\n";
+ print "Sending requests to ".$remailer->{'address'}."\n"
+ if Echolot::Config::get()->{'verbose'};
for my $type (qw{conf key help stats}) {
Echolot::Tools::send_message(
'To' => $remailer->{'address'},
@@ -68,6 +69,20 @@ sub remailer_conf($$$) {
} else {
Echolot::Globals::get()->{'storage'}->restore_ttl( $remailer->{'address'} );
Echolot::Globals::get()->{'storage'}->set_caps($remailer_type, $remailer_caps, $remailer_nick, $remailer_address, $time);
+
+ # if remailer is cpunk and not pgponly
+ if (($remailer_caps =~ /\bcpunk\b/) && !($remailer_caps =~ /\bpgponly\b/)) {
+ Echolot::Globals::get()->{'storage'}->set_key(
+ 'cpunk-clear',
+ $remailer_nick,
+ $remailer->{'address'},
+ 'N/A',
+ 'none',
+ 'N/A',
+ 'N/A',
+ 'N/A',
+ $time);
+ }
}
@@ -192,9 +207,9 @@ sub parse_cpunk_key($$$) {
my @pgp_keys = ($reply =~ /^-----BEGIN \s PGP \s PUBLIC \s KEY \s BLOCK-----\r?\n
(?:.+\r?\n)*
- \r?\n
- (?:[a-zA-Z0-9+\/=]*\r?\n)+
- -----END \s PGP \s PUBLIC \s KEY \s BLOCK-----$/xmg );
+ \r?\n
+ (?:[a-zA-Z0-9+\/=]*\r?\n)+
+ -----END \s PGP \s PUBLIC \s KEY \s BLOCK-----$/xmg );
for my $key (@pgp_keys) {
my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh )
= ( IO::Handle->new(),
diff --git a/Echolot/Pinger.pm b/Echolot/Pinger.pm
index 6ffe729..86ba068 100644
--- a/Echolot/Pinger.pm
+++ b/Echolot/Pinger.pm
@@ -1,7 +1,7 @@
package Echolot::Pinger;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Pinger.pm,v 1.9 2002/07/02 17:04:51 weasel Exp $
+# $Id: Pinger.pm,v 1.10 2002/07/02 18:03:55 weasel Exp $
#
=pod
@@ -50,13 +50,18 @@ sub do_mix_ping($$$$$) {
sub do_cpunk_ping($$$$$$) {
my ($address, $type, $keyid, $time, $to, $body) = @_;
- my %key = Echolot::Globals::get()->{'storage'}->get_key($address, $type, $keyid);
+ my $keyhash;
+ if ($type ne 'cpunk-clear') {
+ my %key = Echolot::Globals::get()->{'storage'}->get_key($address, $type, $keyid);
+ $keyhash = { $keyid => \%key };
+ };
Echolot::Pinger::CPunk::ping(
$body,
$to,
[ { address => $address,
- keyid => $keyid } ],
- { $keyid => \%key },
+ keyid => $keyid,
+ encrypt => ($type ne 'cpunk-clear') } ],
+ $keyhash,
$type eq 'cpunk-rsa' ) or
return 0;
@@ -78,7 +83,7 @@ sub do_ping($$$) {
my $to = Echolot::Tools::make_address('ping');
if ($type eq 'mix') {
do_mix_ping($address, $key, $now, $to, $body);
- } elsif ($type eq 'cpunk-rsa' || $type eq 'cpunk-dsa') {
+ } elsif ($type eq 'cpunk-rsa' || $type eq 'cpunk-dsa' || $type eq 'cpunk-clear') {
do_cpunk_ping($address, $type, $key, $now, $to, $body);
} else {
cluck ("Don't know how to handle ping type $type");
diff --git a/Echolot/Pinger/CPunk.pm b/Echolot/Pinger/CPunk.pm
index 2c80d4d..90b8b8a 100644
--- a/Echolot/Pinger/CPunk.pm
+++ b/Echolot/Pinger/CPunk.pm
@@ -1,7 +1,7 @@
package Echolot::Pinger::CPunk;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: CPunk.pm,v 1.3 2002/07/02 14:21:38 weasel Exp $
+# $Id: CPunk.pm,v 1.4 2002/07/02 18:03:55 weasel Exp $
#
=pod
@@ -196,14 +196,17 @@ sub ping($$$$$) {
"Anon-To: $to\n".
"\n".
$msg;
- my $encrypted = encrypt_to($msg, $hop->{'keyid'}, $keys, $pgp2compat);
- (defined $encrypted) or
- cluck("Encrypted is undefined"),
- return undef;
- $msg = "::\n".
- "Encrypted: PGP\n".
- "\n".
- $encrypted;
+
+ if ($hop->{'encrypt'}) {
+ my $encrypted = encrypt_to($msg, $hop->{'keyid'}, $keys, $pgp2compat);
+ (defined $encrypted) or
+ cluck("Encrypted is undefined"),
+ return undef;
+ $msg = "::\n".
+ "Encrypted: PGP\n".
+ "\n".
+ $encrypted;
+ };
$to = $hop->{'address'};
}
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm
index 013e398..ea91066 100644
--- a/Echolot/Stats.pm
+++ b/Echolot/Stats.pm
@@ -1,7 +1,7 @@
package Echolot::Stats;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Stats.pm,v 1.7 2002/07/02 17:05:22 weasel Exp $
+# $Id: Stats.pm,v 1.8 2002/07/02 18:03:55 weasel Exp $
#
=pod
@@ -388,7 +388,7 @@ sub build_lists() {
build_mlist1( \@rems, 'mlist');
build_list2( \@rems, 'mlist2');
- $rems = build_rems(['cpunk-rsa', 'cpunk-dsa']);
+ $rems = build_rems(['cpunk-rsa', 'cpunk-dsa', 'cpunk-clear']);
@rems = grep { $_->{'showit'} } @$rems;
build_rlist1( \@rems, 'rlist');
build_list2( \@rems, 'rlist2');
diff --git a/TODO b/TODO
index 4966e41..919087f 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,6 @@
for 2.0:
make setup easy/document setup
make a private [rm]list showing all remailers
- ping cpunk without pgponly in clear too
configure pinging options (i.e. cpunkt-{rsa,dsa,none}, mix)
for later: