From 61c3bfd8672d0af49887bdbc29f6871f199f4d4c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 12 May 2014 10:10:13 -0400 Subject: [PATCH] Fix coping with incoming packet in incomplete state If a session is partially ready to go, but not fully, drop packets. This can occur if just the right packets drop such that the remote end gets going but the local end does not receive them. Change-Id: I63ac506484a1792db673f6e90e13cc4b0132719c --- pyghmi/ipmi/private/session.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index e3df0d13..0ec38434 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -1059,6 +1059,8 @@ class Session(object): if data[5] & 0b10000000: encrypted = 1 authcode = rawdata[-12:] + if self.k1 is None: # we are in no shape to process a packet now + return expectedauthcode = hmac.new( self.k1, rawdata[4:-12], hashlib.sha1).digest()[:12] if authcode != expectedauthcode: