Announce and validation

This commit is contained in:
Mark Qvist
2018-03-19 18:11:50 +01:00
parent 3ea36ff9b3
commit 82744fb9ed
6 changed files with 125 additions and 35 deletions
+15 -1
View File
@@ -162,4 +162,18 @@ class Destination:
# Creates an announce packet for this destination.
# Application specific data can be added to the announce.
def announce(self,app_data=None):
pass
destination_hash = self.hash
random_hash = self.identity.getRandomHash()
signed_data = self.hash+self.identity.getPublicKey()+random_hash
if app_data != None:
signed_data += app_data
signature = self.identity.sign(signed_data)
announce_data = self.hash+self.identity.getPublicKey()+random_hash+signature
if app_data != None:
announce_data += app_data
FPE.Packet(self, announce_data, FPE.Packet.ANNOUNCE).send()