summaryrefslogtreecommitdiff
path: root/pysnmp/proto
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/proto')
-rw-r--r--pysnmp/proto/secmod/eso/priv/des3.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pysnmp/proto/secmod/eso/priv/des3.py b/pysnmp/proto/secmod/eso/priv/des3.py
index d5022089..97ba156d 100644
--- a/pysnmp/proto/secmod/eso/priv/des3.py
+++ b/pysnmp/proto/secmod/eso/priv/des3.py
@@ -68,6 +68,13 @@ class Des3(base.AbstractEncryptionService):
'Unknown auth protocol %s' % (authProtocol,)
)
localPrivKey = localkey.localizeKey(privKey, snmpEngineID, hashAlgo)
+
+ # now extend this key if too short by repeating steps that includes the hashPassphrase step
+ while len(localPrivKey) < self.keySize:
+ # this is the difference between reeder and bluementhal
+ newKey = localkey.hashPassphrase(localPrivKey, hashAlgo)
+ localPrivKey += localkey.localizeKey(newKey, snmpEngineID, hashAlgo)
+
return localPrivKey[:self.keySize]
# 5.1.1.1