diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-11-16 22:42:22 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-11-16 22:42:22 -0500 |
commit | a211f547491abf2c517e77dfa3cfc4b2205d1a4d (patch) | |
tree | 63cd5ff4ade028fc9108aa09ca61513a4fc897b2 | |
parent | be356d80fefa57fbaf58865bde4689fbae30ed09 (diff) | |
parent | 7c0778ef7e05e859c62346a795952f127972b35e (diff) | |
download | tor-a211f547491abf2c517e77dfa3cfc4b2205d1a4d.tar.gz tor-a211f547491abf2c517e77dfa3cfc4b2205d1a4d.zip |
Merge branch 'maint-0.4.3' into release-0.4.3
-rw-r--r-- | changes/bug40179_part1 | 4 | ||||
-rw-r--r-- | src/test/hs_ntor_ref.py | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/changes/bug40179_part1 b/changes/bug40179_part1 new file mode 100644 index 0000000000..c302373534 --- /dev/null +++ b/changes/bug40179_part1 @@ -0,0 +1,4 @@ + o Minor bugfixes (testing, portability): + - Fix our Python reference-implementation for the v3 onion service + handshake so that it works correctly with the version of hashlib provided + by Python 3.9. Fixes part of bug 40179; bugfix on 0.3.1.6-rc. diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py index f107cc36ca..98025dd584 100644 --- a/src/test/hs_ntor_ref.py +++ b/src/test/hs_ntor_ref.py @@ -70,14 +70,16 @@ except ImportError: try: # Pull the sha3 functions in. from hashlib import sha3_256, shake_256 - shake_squeeze = shake_256.digest + def shake_squeeze(obj, n): + return obj.digest(n) except ImportError: if hasattr(sha3, "SHA3256"): # If this happens, then we have the old "sha3" module which # hashlib and pysha3 superseded. sha3_256 = sha3.SHA3256 shake_256 = sha3.SHAKE256 - shake_squeeze = shake_256.squeeze + def shake_squeeze(obj, n): + return obj.squeeze(n) else: # error code 77 tells automake to skip this test sys.exit(77) |