From 981769b051292981992c5d7ee37e5d0ebfae18df Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Wed, 29 Jun 2022 17:53:41 +0000 Subject: [PATCH 1/2] improve error message this commit is adopted from d0069471b8bcf0a61b6c5a9849621f255580065a (https://github.com/zeronet-enhanced/ZeroNet/commit/d0069471b8bcf0a61b6c5a9849621f255580065a) by @geekless with original commit message: Don't raise VerifyError with misleading message "Invalid old-style sign" when the file has no sign at all. --- src/Content/ContentManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 27da402b..20568701 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -998,8 +998,10 @@ class ContentManager(object): raise VerifyError("Valid signs: %s/%s" % (valid_signs, signs_required)) else: return self.verifyContent(inner_path, new_content) - else: # Old style signing + elif sign: raise VerifyError("Invalid old-style sign") + else: + raise VerifyError("Not signed") except Exception as err: self.log.warning("%s: verify sign error: %s" % (inner_path, Debug.formatException(err))) From aa19bcf2e0d4a14c63532b8bd1393429ff0a2ec3 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Wed, 29 Jun 2022 18:50:55 +0000 Subject: [PATCH 2/2] remove potential fingerprinting of site owner inspired by @geekless 's 829fd4678133e527d34ac395c6c5bf3da20f8050 commit at https://github.com/zeronet-enhanced/ZeroNet/commit/829fd4678133e527d34ac395c6c5bf3da20f8050 previously 0net would announce owned sites more frequently which can help determine site owner --- src/File/FileServer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/File/FileServer.py b/src/File/FileServer.py index e5fd4edf..7c803041 100644 --- a/src/File/FileServer.py +++ b/src/File/FileServer.py @@ -313,8 +313,8 @@ class FileServer(ConnectionServer): def announceSite(self, site): site.announce(mode="update", pex=False) active_site = time.time() - site.settings.get("modified", 0) < 24 * 60 * 60 - if site.settings["own"] or active_site: - # Check connections more frequently on own and active sites to speed-up first connections + if active_site: + # Check connections more frequently on active sites to speed-up first connections site.needConnections(check_site_on_reconnect=True) site.sendMyHashfield(3) site.updateHashfield(3)