summaryrefslogtreecommitdiff
path: root/Echolot/Conf.pm
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-04-24 10:50:02 +0000
committerPeter Palfrader <peter@palfrader.org>2004-04-24 10:50:02 +0000
commit76e2deb98e31184511fd0c6cdc7d9b079a433da3 (patch)
treedf05b3c8dbb8f9127f496dc0e9e2034dc0481004 /Echolot/Conf.pm
parent54452b9931d8bc255b5706dbeade6432dd28e317 (diff)
Do not accept expired or future mixmaster keys
Diffstat (limited to 'Echolot/Conf.pm')
-rw-r--r--Echolot/Conf.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Echolot/Conf.pm b/Echolot/Conf.pm
index 0c3eb50..83f53cc 100644
--- a/Echolot/Conf.pm
+++ b/Echolot/Conf.pm
@@ -289,6 +289,8 @@ sub parse_mix_key($$$) {
address => $address,
version => $version,
caps => $caps,
+ created => $created,
+ expires => $expires,
summary => $_
};
};
@@ -312,6 +314,14 @@ sub parse_mix_key($$$) {
(! defined $mixmasters{$keyid}->{'nick'} && defined $mixmasters{$keyid}->{'key'}) and
Echolot::Log::info("Mixmaster key without key header in reply from $remailer_address."),
next;
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime();
+ my $today = sprintf("%04d-%02d-%02d", $year+1900, $mon+1, $mday);
+ (defined $mixmasters{$keyid}->{'created'} && ($today lt $mixmasters{$keyid}->{'created'})) and
+ Echolot::Log::info("Mixmaster key for $remailer_address created in the future ($today < $created)."),
+ next;
+ (defined $mixmasters{$keyid}->{'expires'} && ($mixmasters{$keyid}->{'expires'} lt $today)) and
+ Echolot::Log::info("Mixmaster key for $remailer_address expired ($expires < $today)."),
+ next;
if ($remailer->{'address'} ne $remailer_address) {
# Address mismatch -> Ignore reply and add $remailer_address to prospective addresses