mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-22 21:50:18 +00:00
Fixed race condition when timed-out link receives a late establishment proof a few milliseconds after it has timed out
This commit is contained in:
parent
a8a7af4b74
commit
4f78973751
@ -225,6 +225,7 @@ 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)
|
||||||
|
|
||||||
@ -234,6 +235,8 @@ class Link:
|
|||||||
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):
|
||||||
|
Loading…
Reference in New Issue
Block a user