mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-23 06:00:18 +00:00
Compare commits
No commits in common. "ffa6bec3b486d1e69b29cb57161c4b9098f3825b" and "a8a7af4b7455f5eb5e2db796701e2b4351e6b610" have entirely different histories.
ffa6bec3b4
...
a8a7af4b74
19
RNS/Link.py
19
RNS/Link.py
@ -225,18 +225,15 @@ class Link:
|
|||||||
self.hash = self.link_id
|
self.hash = self.link_id
|
||||||
|
|
||||||
def handshake(self):
|
def handshake(self):
|
||||||
if self.status == Link.PENDING and self.prv != None:
|
self.status = Link.HANDSHAKE
|
||||||
self.status = Link.HANDSHAKE
|
self.shared_key = self.prv.exchange(self.peer_pub)
|
||||||
self.shared_key = self.prv.exchange(self.peer_pub)
|
|
||||||
|
|
||||||
self.derived_key = RNS.Cryptography.hkdf(
|
self.derived_key = RNS.Cryptography.hkdf(
|
||||||
length=32,
|
length=32,
|
||||||
derive_from=self.shared_key,
|
derive_from=self.shared_key,
|
||||||
salt=self.get_salt(),
|
salt=self.get_salt(),
|
||||||
context=self.get_context(),
|
context=self.get_context(),
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
RNS.log("Handshake attempt on "+str(self)+" with invalid state "+str(self.status), RNS.LOG_ERROR)
|
|
||||||
|
|
||||||
|
|
||||||
def prove(self):
|
def prove(self):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!python3
|
||||||
|
|
||||||
# MIT License
|
# MIT License
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user