Skip to content

Commit

Permalink
repair issue where minions don't reauth when master is restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed Nov 6, 2011
1 parent 224d526 commit 02ad503
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions salt/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 02ad503

Please sign in to comment.