mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
Merge remote-tracking branch 'tor-gitlab/mr/195' into maint-0.3.5
This commit is contained in:
commit
fcae26adf7
4
changes/bug40179_part1
Normal file
4
changes/bug40179_part1
Normal file
@ -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.
|
@ -65,14 +65,16 @@ except ImportError:
|
|||||||
try:
|
try:
|
||||||
# Pull the sha3 functions in.
|
# Pull the sha3 functions in.
|
||||||
from hashlib import sha3_256, shake_256
|
from hashlib import sha3_256, shake_256
|
||||||
shake_squeeze = shake_256.digest
|
def shake_squeeze(obj, n):
|
||||||
|
return obj.digest(n)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if hasattr(sha3, "SHA3256"):
|
if hasattr(sha3, "SHA3256"):
|
||||||
# If this happens, then we have the old "sha3" module which
|
# If this happens, then we have the old "sha3" module which
|
||||||
# hashlib and pysha3 superseded.
|
# hashlib and pysha3 superseded.
|
||||||
sha3_256 = sha3.SHA3256
|
sha3_256 = sha3.SHA3256
|
||||||
shake_256 = sha3.SHAKE256
|
shake_256 = sha3.SHAKE256
|
||||||
shake_squeeze = shake_256.squeeze
|
def shake_squeeze(obj, n):
|
||||||
|
return obj.squeeze(n)
|
||||||
else:
|
else:
|
||||||
# error code 77 tells automake to skip this test
|
# error code 77 tells automake to skip this test
|
||||||
sys.exit(77)
|
sys.exit(77)
|
||||||
|
Loading…
Reference in New Issue
Block a user