diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-09-13 21:06:25 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-14 09:13:11 -0400 |
commit | 0ac2afad0dc99ff6ce15f4cf63dcd2b9b3c6b637 (patch) | |
tree | 9bc97ea8e3c0540ea90d71f731f291adddeb51a8 /src/test/hs_build_address.py | |
parent | dcaf971a01f912d74a076d53baf7689460c3474e (diff) | |
download | tor-0ac2afad0dc99ff6ce15f4cf63dcd2b9b3c6b637.tar.gz tor-0ac2afad0dc99ff6ce15f4cf63dcd2b9b3c6b637.zip |
prop224 client-side: Start validating onion address pubkeys.
Fix the test_build_address() test and its test vectors python script.
They were both using a bogus pubkey for building an HS address which
does not validate anymore.
Also fix a few more unittests that were using bogus onion addresses
and were failing the validation. I replaced the bogus address with
the one generated from the test vector script.
Diffstat (limited to 'src/test/hs_build_address.py')
-rw-r--r-- | src/test/hs_build_address.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/hs_build_address.py b/src/test/hs_build_address.py index 7be9c8b85a..7ff22c3a9a 100644 --- a/src/test/hs_build_address.py +++ b/src/test/hs_build_address.py @@ -21,8 +21,9 @@ if TEST_VALUE != sha3.sha3_256(b"Hello World").hexdigest(): # Checksum is built like so: # CHECKSUM = SHA3(".onion checksum" || PUBKEY || VERSION) PREFIX = ".onion checksum".encode() -# 32 bytes ed25519 pubkey. -PUBKEY = ("\x42" * 32).encode() +# 32 bytes ed25519 pubkey from first test vector of +# https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02#section-6 +PUBKEY = "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a".decode('hex') # Version 3 is proposal224 VERSION = 3 |