- Mar 05, 2020
-
-
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.
-
- Feb 19, 2020
-
-
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.
-
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.
-
Damian Johnson authored
Audited our library's cryptography imports for exception handling when unavailable, and consistently document when it's required.
-
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 ...
-
- Feb 18, 2020
-
-
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.
-
- Feb 17, 2020
-
-
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.
-
- Feb 11, 2020
-
-
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.
-
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).
-
- Feb 10, 2020
-
-
Damian Johnson authored
Oops, I removed our LogBuffer in commit 76b6b49f but it's still used by run_tests.py when we have a '--log' argument. Caught thanks to our Jenkins tests... Traceback (most recent call last): File "./run_tests.py", line 478, in <module> main() File "./run_tests.py", line 238, in main handler = logging_buffer = stem.util.log.LogBuffer(args.logging_runlevel) AttributeError: module 'stem.util.log' has no attribute 'LogBuffer'
-
Damian Johnson authored
Doubtless there will be more opportunities to simplify, but for now cleaning out the low hanging fruit. Dropping Sphinx documented deprecations and simple TODO comments.
-
Damian Johnson authored
-
Damian Johnson authored
Earlier I replaced our usage of stem.util.conf as a cache with sqlite. Faster, cleaner, and clearly the right option. We can now drop the legacy code.
-
Damian Johnson authored
Now that we're using python 3.x our sqlite module's uri mode can allow us to open our cache in a read-only manner... https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
-
Damian Johnson authored
-
Damian Johnson authored
Huh, odd. I could've sworn that I called this BaseHiddenServiceDescriptor because HiddenServiceDescriptorV2 was originally called that so it still retained an alias for the old name but I'm not spotting it. Oh well.
-
Damian Johnson authored
Renaming this class to more fittingly live aside their v3 counterpart.
-
Damian Johnson authored
Huh, wonder why this code was still around. Ticket 28615 was closed a long while ago...
-
Damian Johnson authored
The pep8 module renamed itself to pycodestyle at Guido's request a while ago. Stem was compatible with both but this was long enough ago that we can drop support for the old module.
-
Damian Johnson authored
Just a few classes implemented a sign argument. Subclasses already customize their signature when necessary so we can limit it to just the classes that use it.
-
Damian Johnson authored
Couple attributes that were never used (they were misdocumentations in the spec).
-
Damian Johnson authored
Redundant with the to_base64() method.
-
Damian Johnson authored
-
- Feb 09, 2020
-
-
Damian Johnson authored
Old alias for v3ident.
-
- Feb 08, 2020
-
-
Damian Johnson authored
-
Damian Johnson authored
-
Damian Johnson authored
-
Damian Johnson authored
This attribute was never implemented within tor.
-
Damian Johnson authored
Microdescriptor identifiers can appear multiple times so these attributes were replaced with a hash.
-
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
-
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
-
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.
-
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.
-
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.
-
Damian Johnson authored
Redundant with the DirectoryAuthority's from_cache() function.
-
Damian Johnson authored
Removing a couple very old methods that are redundant with connect.
-
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.
-
Damian Johnson authored
A simple string-to-string hash could not convey multi-value configuration values so we replaced it.
-
Damian Johnson authored
This attribute was a moving target that frequenly got out of date so we deprecated it a while ago.
-
Damian Johnson authored
Removing get_socks_listeners and is_geoip_unavailable as both have better counterparts nowadays.
-