From 8a49b7dc339cae113555cbf149b66940a876df95 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sun, 11 Aug 2019 09:49:14 +0200 Subject: [PATCH] Fix crash on AES key localization --- pysnmp/proto/secmod/eso/priv/aesbase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pysnmp/proto/secmod/eso/priv/aesbase.py b/pysnmp/proto/secmod/eso/priv/aesbase.py index 676afbbbc..cb6287337 100644 --- a/pysnmp/proto/secmod/eso/priv/aesbase.py +++ b/pysnmp/proto/secmod/eso/priv/aesbase.py @@ -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]