From bfe9840737e1b0592deedbd9014f27e558d36dbc Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 26 Apr 2021 18:29:54 -0700 Subject: [PATCH] update to moving the tag to the end... --- lora.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lora.py b/lora.py index e9d741f..94c6ee9 100644 --- a/lora.py +++ b/lora.py @@ -24,7 +24,7 @@ class LORANode(object): self.st = Strobe(domain) async def start(self): - msg = self.st.send_enc(b'reqreset' + os.urandom(16)) + \ + msg = self.st.send_enc(os.urandom(16) + b'reqreset') + \ self.st.send_mac(8) resp = await self.sd.sendtillrecv(msg, 1) @@ -182,7 +182,7 @@ class TestLORANode(unittest.IsolatedAsyncioTestCase): pkt = l.recv_enc(r[:-8]) l.recv_mac(r[-8:]) - assert pkt.startswith(b'reqreset') + assert pkt.endswith(b'reqreset') await self.put(l.send_enc(os.urandom(16)) + l.send_mac(8))