commit 1bf55b5aa58e89b8654d6bb7d9458bbdcd37b261 Author: Matthew Finkel Matthew.Finkel@gmail.com Date: Sun Feb 2 02:55:04 2014 +0000
We need to remember the digests of the documents the bridge published --- lib/bridgedb/Bridges.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 2c1b34e..9e07ad8 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -131,6 +131,9 @@ class Bridge: self.transports = transports self.running = self.stable = None self.blockingCountries = {} + self.desc_digest = None + self.ei_digest = None + self.verified = False
if id_digest is not None: assert fingerprint is None @@ -145,6 +148,22 @@ class Bridge: else: raise TypeError("Bridge with no ID")
+ def setDescriptorDigest(self, digest): + """Set the descriptor digest, specified in the NS.""" + self.desc_digest = digest + + def setExtraInfoDigest(self, digest): + """Set the extra-info digest, specified in the descriptor.""" + self.ei_digest = digest + + def setVerified(self): + """Call when the bridge's descriptor is parsed""" + self.verified = True + + def isVerified(self): + """Returns the truthiness of ``verified``""" + return self.verified + def getID(self): """Return the bridge's identity digest.""" return fromHex(self.fingerprint)
tor-commits@lists.torproject.org