From 994071243fc80990cf09e820b671006e9bd31c76 Mon Sep 17 00:00:00 2001 From: Gab <24553253+gabrix73@users.noreply.github.com> Date: Thu, 13 Aug 2026 14:04:30 +0200 Subject: Separate active YAMN code from Katzenpost PoC --- download_remailers.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'download_remailers.php') diff --git a/download_remailers.php b/download_remailers.php index 3b40607..d601ac6 100644 --- a/download_remailers.php +++ b/download_remailers.php @@ -61,9 +61,9 @@ class SecureRemailerDownloader { /** * Download remailer stats (mlist.txt) */ - private function downloadStats() { + private function downloadStats(bool $force = false) { // Check if update is needed (with randomized interval) - if (!$this->needsUpdate($this->remailersFile)) { + if (!$force && !$this->needsUpdate($this->remailersFile)) { $this->log("Stats update not needed yet"); return true; } @@ -109,9 +109,9 @@ class SecureRemailerDownloader { /** * Download public keyring (pubring.mix) */ - private function downloadKeyring() { + private function downloadKeyring(bool $force = false) { // Check if update is needed (with randomized interval) - if (!$this->needsUpdate($this->pubringFile)) { + if (!$force && !$this->needsUpdate($this->pubringFile)) { $this->log("Keyring update not needed yet"); return true; } @@ -538,8 +538,8 @@ class SecureRemailerDownloader { * Force update of both stats and keyring */ public function forceUpdate() { - $statsResult = $this->downloadStats(); - $keyringResult = $this->downloadKeyring(); + $statsResult = $this->downloadStats(true); + $keyringResult = $this->downloadKeyring(true); return $statsResult && $keyringResult; } @@ -572,12 +572,4 @@ class SecureRemailerDownloader { } } -// Usage -try { - $downloader = new SecureRemailerDownloader(); - $downloader->downloadRemailers(); -} catch (Exception $e) { - error_log("Remailer download failed: " . $e->getMessage()); -} ?> - -- cgit v1.2.3