Skip to content

Commit 02ad503

Browse files
committed
repair issue where minions don't reauth when master is restarted
1 parent 224d526 commit 02ad503

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

salt/crypt.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ def decrypt(self, data):
273273
data = data[:-self.SIG_SIZE]
274274
if hmac.new(hmac_key, data, hashlib.sha256).digest() != sig:
275275
log.warning('Failed to authenticate message')
276-
return ''
277-
#raise AuthenticationError('message authentication failed')
276+
raise AuthenticationError('message authentication failed')
278277
iv_bytes = data[:self.AES_BLOCK_SIZE]
279278
data = data[self.AES_BLOCK_SIZE:]
280279
cypher = AES.new(aes_key, AES.MODE_CBC, iv_bytes)

salt/master.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ def _handle_aes(self, load):
275275
'''
276276
Handle a command sent via an aes key
277277
'''
278-
data = self.crypticle.loads(load)
278+
try:
279+
data = self.crypticle.loads(load)
280+
except:
281+
return ''
279282
if not data.has_key('cmd'):
280283
log.error('Recieved malformed command {0}'.format(data))
281284
return {}

0 commit comments

Comments
 (0)