From 0ac2afad0dc99ff6ce15f4cf63dcd2b9b3c6b637 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Wed, 13 Sep 2017 21:06:25 +0300 Subject: 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. --- src/test/hs_build_address.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/test/hs_build_address.py') 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 -- cgit v1.2.3-54-g00ecf