[Cryptech-Commits] [sw/libhal] branch pkcs8 updated: Reject malformed messages from RPC UART, not just too-short ones.

git at cryptech.is git at cryptech.is
Tue Apr 11 05:16:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch pkcs8
in repository sw/libhal.

The following commit(s) were added to refs/heads/pkcs8 by this push:
     new 482cc1a  Reject malformed messages from RPC UART, not just too-short ones.
     new 9798cf2  Merge branch 'pymux' into pkcs8
482cc1a is described below

commit 482cc1a5f135e5c6f66f124ec134e6423fbae115
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Tue Apr 11 01:08:04 2017 -0400

    Reject malformed messages from RPC UART, not just too-short ones.
---
 cryptech_muxd | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cryptech_muxd b/cryptech_muxd
index 269ac15..dacf889 100755
--- a/cryptech_muxd
+++ b/cryptech_muxd
@@ -166,11 +166,12 @@ class RPCIOStream(SerialIOStream):
             logger.debug("RPC recv: %s", ":".join("{:02x}".format(ord(c)) for c in reply))
             try:
                 handle = client_handle_get(slip_decode(reply))
+                queue  = self.queues[handle]
             except:
                 continue
             logger.debug("RPC queue put: handle 0x%x, qsize %s, maxsize %s",
-                         handle, self.queues[handle].qsize(), self.queues[handle].maxsize)
-            self.queues[handle].put_nowait(reply)
+                         handle, queue.qsize(), queue.maxsize)
+            queue.put_nowait(reply)
 
 
 class QueuedStreamClosedError(tornado.iostream.StreamClosedError):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list