mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
repair bad return value in authentication checks
This commit is contained in:
parent
8ce25aa6da
commit
2385e77adc
@ -273,7 +273,7 @@ class Crypticle(object):
|
||||
data = data[:-self.SIG_SIZE]
|
||||
if hmac.new(hmac_key, data, hashlib.sha256).digest() != sig:
|
||||
log.warning('Failed to authenticate message')
|
||||
return {}
|
||||
return ''
|
||||
#raise AuthenticationError('message authentication failed')
|
||||
iv_bytes = data[:self.AES_BLOCK_SIZE]
|
||||
data = data[self.AES_BLOCK_SIZE:]
|
||||
@ -293,7 +293,7 @@ class Crypticle(object):
|
||||
'''
|
||||
data = self.decrypt(data)
|
||||
# simple integrity check to verify that we got meaningful data
|
||||
if data.startswith(self.PICKLE_PAD):
|
||||
if not data.startswith(self.PICKLE_PAD):
|
||||
return {}
|
||||
return pickler.loads(data[len(self.PICKLE_PAD):])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user