- 2F8E9DF6CF92A779900080F585A1B9873218D949BE48299950C2B05A64FD5A3ABD8AB927F5C5D4C5D51E7C3DEF2BAB13A6FFE532907E681883730D60BD75B0E5
+ A7F781100F32373DF224F187126FCC44DCFB4B4A8BB53E60E1ACAFDCFF0A9CFD71D47F40E50C6C6F3F7C92A5EB4821B8EEC22ECAC01A84AA1E7F67204A9A220E
blatta/lib/infosec.py
(40 . 7)(40 . 6)
26
27 def message(self, message):
28 # if we are not rebroadcasting we need to set the timestamp
29
30 if message.timestamp == None:
31 message.original = True
32 message.timestamp = int(time.time())
(59 . 7)(58 . 11)
34 logging.debug("Aborting message: unknown handle: %s" % message.handle)
35 return
36
37 message_bytes = self.get_message_bytes(message, target_peer)
38 if message.message_bytes == None:
39 message_bytes = self.get_message_bytes(message, target_peer)
40 else:
41 message_bytes = message.message_bytes
42
43 if message.command != IGNORE:
44 message_hash = binascii.hexlify(hashlib.sha256(message_bytes).digest())
45 logging.debug("generated message_hash: %s" % message_hash)
(70 . 12)(73 . 16)
47 signed_packet_bytes = self.pack(target_peer, message, message_bytes)
48 target_peer.send(signed_packet_bytes)
49 elif message.command == BROADCAST or message.command == IGNORE:
50 # sanity check
51 if message.message_bytes and message_bytes != message_bytes:
52 logging.debug("aborting send: message modified by station!")
53 return
54
55 for peer in self.state.get_keyed_peers():
56
57 # we don't want to send a broadcast back to the originator
58
59 if message.peer and (peer.peer_id == message.peer.peer_id):
60 next
61 continue
62
63 signed_packet_bytes = self.pack(peer, message, message_bytes)
64 peer.send(signed_packet_bytes)
(225 . 7)(232 . 8)
66 "self_chain": self_chain,
67 "net_chain": net_chain,
68 "self_chain_valid": self_chain_valid,
69 "message_hash": message_hash
70 "message_hash": message_hash,
71 "message_bytes": message_bytes
72 })
73
74 # check for duplicates