From 76e2deb98e31184511fd0c6cdc7d9b079a433da3 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 24 Apr 2004 10:50:02 +0000 Subject: Do not accept expired or future mixmaster keys --- Echolot/Conf.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Echolot') 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 -- cgit v1.2.3