[tor-commits] [bridgedb/develop] Make Bridge server-descriptor checks raise exceptions.

isis at torproject.org isis at torproject.org
Thu Feb 19 02:21:13 UTC 2015


commit aa6015a7bdb8208a4ca51b05de04f12d6be8b536
Author: Isis Lovecruft <isis at torproject.org>
Date:   Thu Dec 11 03:54:30 2014 +0000

    Make Bridge server-descriptor checks raise exceptions.
---
 lib/bridgedb/bridges.py |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index 5498758..4ae54c6 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -1221,15 +1221,13 @@ class Bridge(BridgeBackwardsCompatibility):
         :type descriptor:
             :api:`stem.descriptor.server_descriptor.RelayDescriptor`
         :param descriptor:
+        :raises MalformedBridgeInfo: If this Bridge has no corresponding
+            networkstatus entry, or its **descriptor** digest didn't match the
+            expected digest (from the networkstatus entry).
         """
+        self._checkServerDescriptor(descriptor)
         self.descriptors['server'] = descriptor
 
-        try:
-            self._checkServerDescriptor(descriptor)
-        except ValueError as error:
-            logging.warn(error)
-            # XXX should we throw away this descriptor?
-
         # Replace the values which we harvested from the networkstatus
         # descriptor, because that one isn't signed with the bridge's identity
         # key.





More information about the tor-commits mailing list