From 8b8d4410ef2bd85d4bcf5b6e8313727ce12c26da Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 18 Sep 2021 18:21:32 +0200 Subject: [PATCH] Work on tunnels --- RNS/Transport.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 54fbef7..63dec3c 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -945,10 +945,12 @@ class Transport: expected_length = RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+RNS.Reticulum.TRUNCATED_HASHLENGTH//8+RNS.Identity.SIGLENGTH//8 if len(data) == expected_length: - public_key = data[:RNS.Identity.KEYSIZE//8] - tunnel_id = RNS.Identity.full_hash(data[:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH]) - random_hash = data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+RNS.Reticulum.TRUNCATED_HASHLENGTH//8] - signature = data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+RNS.Reticulum.TRUNCATED_HASHLENGTH//8:expected_length] + public_key = data[:RNS.Identity.KEYSIZE//8] + tunnel_id_data = data[:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH] + tunnel_id = RNS.Identity.full_hash(tunnel_id_data) + random_hash = data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+RNS.Reticulum.TRUNCATED_HASHLENGTH//8] + signature = data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+RNS.Reticulum.TRUNCATED_HASHLENGTH//8:expected_length] + signed_data = tunnel_id_data+random_hash remote_transport_identity = RNS.Identity(create_keys=False) remote_transport_identity.load_public_key(public_key)