diff --git a/salt/crypt.py b/salt/crypt.py index 92b7ef946f3c..c78913ac3199 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -273,8 +273,7 @@ def decrypt(self, data): data = data[:-self.SIG_SIZE] if hmac.new(hmac_key, data, hashlib.sha256).digest() != sig: log.warning('Failed to authenticate message') - return '' - #raise AuthenticationError('message authentication failed') + raise AuthenticationError('message authentication failed') iv_bytes = data[:self.AES_BLOCK_SIZE] data = data[self.AES_BLOCK_SIZE:] cypher = AES.new(aes_key, AES.MODE_CBC, iv_bytes) diff --git a/salt/master.py b/salt/master.py index 4a6713be036d..0c0219554a3b 100644 --- a/salt/master.py +++ b/salt/master.py @@ -275,7 +275,10 @@ def _handle_aes(self, load): ''' Handle a command sent via an aes key ''' - data = self.crypticle.loads(load) + try: + data = self.crypticle.loads(load) + except: + return '' if not data.has_key('cmd'): log.error('Recieved malformed command {0}'.format(data)) return {}