Skip to content
  1. Mar 05, 2020
    • Damian Johnson's avatar
      Extrainfo descriptor transport lines fail validation · 7a0a8dd8
      Damian Johnson authored
      Oops! Transport lines effectviely never appear aside from raw bridge
      descriptors (which we never see), so I didn't have a live example to
      test with.
      
      Now we have one. DocTor's descriptor validation check is failing with...
      
        03/05/2020 00:35:33 [WARNING] Unable to retrieve the extrainfo descriptors: Transport line has a malformed address: transport obfs4 [2001:985:e77:5:fd34:f56b:c2d1:e98c]:10394 cert=dJ/a+vnP+eFv7FDaVUqWCVlyrqf8FlOva2YAEkDUwiGQuorZf4Oc6FXSdyn8b4pUmZj/WA,iat-mode=0
      
      Caught thanks to GeKo.
      7a0a8dd8
  2. Feb 19, 2020
    • Damian Johnson's avatar
      Drop complex version requirement class · 156c408f
      Damian Johnson authored
      Removing a private class that supported version rule chains (for example,
      "check if I'm greater than 1.2.2 in the 1.2 series, or 1.3.5 in the 1.3
      series"). This was only used for a single requirement check which has now
      been removed.
      
      We can always revive this class in the future if it's useful.
      156c408f
    • Damian Johnson's avatar
      Drop tor event version constants · 55906cd9
      Damian Johnson authored
      I doubt anyone has ever used event versions from our Requirement constants.
      Retaining these within the event classes but dropping the clutter from our
      version module.
      55906cd9
    • Damian Johnson's avatar
      Consistently document when cryptography is required · 682fdf18
      Damian Johnson authored
      Audited our library's cryptography imports for exception handling when
      unavailable, and consistently document when it's required.
      682fdf18
    • Damian Johnson's avatar
      Tests required sqlite3 · c4072bd1
      Damian Johnson authored
      Python includes sqlite3 as a builtin, but when you compile python yourself it
      isn't included by default. Our stem.manual attempted to account for this but
      our tests didn't, and with python3 the module raises a ModuleNotFoundError
      rather than an ImportError.
      
        Traceback (most recent call last):
          File "/home/atagar/Desktop/stem/test/task.py", line 160, in _import_tests
            importlib.import_module(module.rsplit('.', 1)[0])
          File "/home/atagar/Python-3.8.1/Lib/importlib/__init__.py", line 127, in import_module
            return _bootstrap._gcd_import(name[level:], package, level)
          File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
          File "<frozen importlib._bootstrap>", line 991, in _find_and_load
          File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
          File "<frozen importlib._bootstrap_external>", line 783, in exec_module
          File "<frozen importlib._bootstrap>", line ...
      c4072bd1
  3. Feb 18, 2020
    • Damian Johnson's avatar
      Drop undocumented 'encoded' attribute from certificates · 657b8acf
      Damian Johnson authored
      When an Ed25519Certificate was created through from_base64() we appended an
      undocumented 'encoded' attribute with the base64 content we were created from.
      Our to_base64() method computes the exact same thing.
      
      This attribute was only used in a single place for server descriptor
      validation.
      
      If 'encoded' and to_base64() mismatches that is a bug. Fiddling with these I
      cound't come up with a scenario where that is a case, so dropping the redundant
      attribute.
      
      Also merging _validate_server_desc_signing_key() into its sole caller.
      657b8acf
  4. Feb 17, 2020
    • Damian Johnson's avatar
      Replace stem.prereq module · 75403ace
      Damian Johnson authored
      Our prereq module provides dependency checks, mostly for python versioning
      (now moot) and the cryptography module.
      
      It is not only cleaner but less error prone to perform dependency checks down
      where their imports are performed rather than upfront. This way import changes
      can't fall out of sync with our upfront checks.
      75403ace
  5. Feb 11, 2020
    • Damian Johnson's avatar
      Skip cryptographic validation of fabricated HSv2 descriptors · 960eb3ae
      Damian Johnson authored
      Oops, when removing unused 'sign' arguments I accidently dropped our
      skip_crypto_validation argument here. George and I invested quite a bit of
      effort into creating cryptographically valid HSv3 descriptors, but HSv2
      descriptors aren't.
      
      This caused the following test failures...
      
        ======================================================================
        ERROR: test_minimal_hidden_service_descriptor
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "/home/atagar/Desktop/stem/test/unit/descriptor/hidden_service_v2.py", line 414, in test_minimal_hidden_service_descriptor
            desc = HiddenServiceDescriptorV2.create()
          File "/home/atagar/Desktop/stem/stem/descriptor/hidden_service.py", line 702, in create
            return cls(cls.content(attr, exclude), validate = validate)
          File "/home/atagar/Desktop/stem/stem/descriptor/hidden_service.py", line 723, in __init__
            signed_digest = self._digest_for_signature(self.permanent_key, self.signature)
          File "/home/atagar/Desktop/stem/stem/descriptor/__init__.py", line 1043, in _digest_for_signature
            key = load_der_public_key(_bytes_for_block(signing_key), default_backend())
          File "/home/atagar/.local/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 32, in load_der_public_key
            return backend.load_der_public_key(data)
          File "/home/atagar/.local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1182, in load_der_public_key
            self._handle_key_loading_error()
          File "/home/atagar/.local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1373, in _handle_key_loading_error
            raise ValueError("Could not deserialize key data.")
        ValueError: Could not deserialize key data.
      960eb3ae
    • Damian Johnson's avatar
      Drop tests for invalid signing argument · 91ef6387
      Damian Johnson authored
      Oops, I forgot to install cryptography under python 3.7 so I didn't exercise
      several tests. This doesn't fix all the failures but corrects the most obvious
      (we removed the sign argument when it was irrelevant).
      91ef6387
  6. Feb 10, 2020
  7. Feb 09, 2020
  8. Feb 08, 2020
    • Damian Johnson's avatar
      Drop redundant microdescriptor digest · d72573be
      Damian Johnson authored
      d72573be
    • Damian Johnson's avatar
      Drop legacy compression enumeration · 5d37fd35
      Damian Johnson authored
      5d37fd35
    • Damian Johnson's avatar
      Drop support for legacy tuple endpoints · 9a0a5437
      Damian Johnson authored
      9a0a5437
    • Damian Johnson's avatar
      Drop hidden service introduction_points_auth · 27cf44b8
      Damian Johnson authored
      This attribute was never implemented within tor.
      27cf44b8
    • Damian Johnson's avatar
      Drop deprecated microdescriptor identifiers · 531119df
      Damian Johnson authored
      Microdescriptor identifiers can appear multiple times so these attributes were
      replaced with a hash.
      531119df
    • Damian Johnson's avatar
      Drop workaround for 'GETINFO onions/current' behavior change · 74615ebf
      Damian Johnson authored
      Back in 2017 we changed this GETINFO option's behavior to return an empty list
      rather than error when no results are available. THis is long enough that we
      can drop this normalization.
      
        https://trac.torproject.org/projects/tor/ticket/21329
      74615ebf
    • Damian Johnson's avatar
      Require online target for server descriptor integ test · e700b387
      Damian Johnson authored
      Odd, we have both a test_get_server_descriptor and test_get_server_descriptors
      (plural) integration test but only the later required the online target. Here
      at a coffee shop I got the following so adding this requirement to the other as
      well.
      
        ======================================================================
        ERROR: test_get_server_descriptor
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "/home/atagar/Desktop/stem/test/require.py", line 58, in wrapped
            return func(self, *args, **kwargs)
          File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 1301, in test_get_server_descriptor
            test_relay = self._get_router_status_entry(controller)
          File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 1489, in _get_router_status_entry
            for desc in controller.get_network_statuses():
          File "/home/atagar/Desktop/stem/stem/control.py", line 482, in wrapped
            for val in func(self, *args, **kwargs):
          File "/home/atagar/Desktop/stem/stem/control.py", line 1979, in get_network_statuses
            raise stem.DescriptorUnavailable('Descriptor information is unavailable, tor might still be downloading it')
        stem.DescriptorUnavailable: Descriptor information is unavailable, tor might still be downloading it
      e700b387
    • Damian Johnson's avatar
      Drop obsolete version constants · 7a4357b2
      Damian Johnson authored
      Removing the constants and version checks for obsolete tor versions. As of
      2/6/20 our consensus has...
      
        client-versions 0.3.5.7,0.3.5.8,0.3.5.9,0.4.1.2-alpha,0.4.1.3-alpha,0.4.1.4-rc,0.4.1.5,0.4.1.6,0.4.1.7,0.4.1.8,0.4.2.1-alpha,0.4.2.2-alpha,0.4.2.3-alpha,0.4.2.4-rc,0.4.2.5,0.4.2.6,0.4.3.1-alpha
        server-versions 0.3.5.8,0.3.5.9,0.4.1.2-alpha,0.4.1.3-alpha,0.4.1.4-rc,0.4.1.5,0.4.1.6,0.4.1.7,0.4.1.8,0.4.2.1-alpha,0.4.2.2-alpha,0.4.2.3-alpha,0.4.2.4-rc,0.4.2.5,0.4.2.6,0.4.3.1-alpha
      
      Stem won't have another release for several months so picked 0.3.5.7 as the
      minimum version to keep. That narrows us down to HSv3 support for HSFETCH and
      tor's new dormant mode.
      7a4357b2
    • Damian Johnson's avatar
      Drop server descriptor ed25519_certificate attribute · 1341bf84
      Damian Johnson authored
      We deprecated this attribute in favor of their parsed 'certificate'. Anyone
      using 'my_descriptor.ed25519_certificate' can replace it with
      'my_descriptor.certificate.encoded' to do the same.
      1341bf84
    • Damian Johnson's avatar
      Drop server descriptor annotations · fb82decc
      Damian Johnson authored
      Server descriptor files within tor's data directory begin with a couple
      annotations. This is the only place where these annotations exist, and
      is not part of tor's dir-spec.
      
      I parsed these annotations for completeness when I first authored Stem.
      However, we effectively never read these files nowadays for a few reasons...
      
        1. Stem's remote and collector modules provide better methods for getting
           descriptors.
      
        2. When tor is running locally we can get this information via GETINFO rather
           than reading directly from disk.
      
        3. Tor is trying to discourage us from reading the data directory from disk
           by restricting its permissions.
      
      This isn't to say there aren't merits to reading on-disk descriptors. Nyx does
      so, for instance, because it's a passive listener (no downloading allowed)
      and massive GETINFO responses noticably lag the control port.
      
      However, reading on-disk descriptors is rare and even in this edge case I'm
      unaware of anyone using the annotations.
      fb82decc
    • Damian Johnson's avatar
      Drop get_authorities · 00cefce1
      Damian Johnson authored
      Redundant with the DirectoryAuthority's from_cache() function.
      00cefce1
    • Damian Johnson's avatar
      Drop connect_port and connect_socket_file · 090e6f2d
      Damian Johnson authored
      Removing a couple very old methods that are redundant with connect.
      090e6f2d
    • Damian Johnson's avatar
      Replace NewConsensusEvent's desc attribute with a method · 56aab048
      Damian Johnson authored
      The consensus is relatively large, so parsing costs time and cpu. Doing this
      when the parsed content is requested rather than when the event is first
      received.
      
      Nyx disabled eager parsing long ago because otherwise this is a significant
      periodic performance hit.
      56aab048
    • Damian Johnson's avatar
      Drop ConfChangedEvent's config attribute · a4b9ad57
      Damian Johnson authored
      A simple string-to-string hash could not convey multi-value configuration
      values so we replaced it.
      a4b9ad57
    • Damian Johnson's avatar
      Drop is_bandwidth_authority dirauth attribute · b8df452a
      Damian Johnson authored
      This attribute was a moving target that frequenly got out of date so we
      deprecated it a while ago.
      b8df452a
    • Damian Johnson's avatar
      Drop deprecated controller methods · 2b776978
      Damian Johnson authored
      Removing get_socks_listeners and is_geoip_unavailable as both have better
      counterparts nowadays.
      2b776978