Skip to content

Commit

Permalink
Fix crash on AES key localization
Browse files Browse the repository at this point in the history
  • Loading branch information
etingof committed Aug 11, 2019
1 parent 3488150 commit 8a49b7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pysnmp/proto/secmod/eso/priv/aesbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def localizeKey(self, authProtocol, privKey, snmpEngineID):

# now extend this key if too short by repeating steps that includes the hashPassphrase step
for count in range(1, int(ceil(self.keySize * 1.0 / len(localPrivKey)))):
localPrivKey += hashAlgo(localPrivKey).digest()
localPrivKey += localPrivKey.clone(
hashAlgo(localPrivKey.asOctets()).digest())

return localPrivKey[:self.keySize]

Expand Down

0 comments on commit 8a49b7d

Please sign in to comment.