Work on tunnels
This commit is contained in:
parent
7d804daa8f
commit
8b8d4410ef
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user