Adjust extended v3 HS address validation
commit63a476056017dda5ede35efc4e4f7acfcc1d7d1a
authorDamian Johnson <atagar@torproject.org>
Wed, 10 Feb 2021 00:12:36 +0000 (9 16:12 -0800)
committerDamian Johnson <atagar@torproject.org>
Wed, 10 Feb 2021 00:14:36 +0000 (9 16:14 -0800)
tree26ff5ba561f57c8ff5233950f930d1d8afce17d6
parent434638a828201c286e5fef158761dc2c4c67e47d
Adjust extended v3 HS address validation

Mostly minor stylistic adjustments. The only functional bit is correcting a
unit test failure...

======================================================================
FAIL: test_identity_key_from_address
----------------------------------------------------------------------
ValueError: '55555555555555555555555555555555555555555555555555555555.onion' isn't a valid hidden service v3 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "/home/atagar/Desktop/stem/test/unit/descriptor/hidden_service_v3.py", line 220, in test_identity_key_from_address
     self.assertRaisesWith(ValueError, 'Bad checksum (expected def7 but was 842e)', HiddenServiceDescriptorV3.identity_key_from_address, '5' * 56)
   File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 249, in assertRaisesWith
     return self.assertRaisesRegexp(exc_type, '^%s$' % re.escape(exc_msg), *args, **kwargs)
AssertionError: "^Bad\ checksum\ \(expected\ def7\ but\ was\ 842e\)$" does not match "'55555555555555555555555555555555555555555555555555555555.onion' isn't a valid hidden service v3 address"

----------------------------------------------------------------------
stem/descriptor/hidden_service.py
stem/util/tor_tools.py
test/unit/util/tor_tools.py