Trap messages are received and decoded properly, when collected using tcpdump and viewed in wireshark.
But with pysnmp lib, getting the below error:
2023-04-11 11:55:54,792 pysnmp: processIncomingMsg: scopedPDU decoder failed <class 'pyasn1.error.SubstrateUnderrunError'> 2023-04-11 11:55:54,792 pysnmp: StatusInformation: {'errorIndication': DecryptionError('Ciphering services not available or ciphertext is broken'), 'msgUserName': <OctetString value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 32>>, encoding iso-8859-1, payload [user1]>} 2023-04-11 11:55:54,792 pysnmp: prepareDataElements: SM failed, statusInformation {'errorIndication': DecryptionError('Ciphering services not available or ciphertext is broken'), 'msgUserName': <OctetString value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 32>>, encoding iso-8859-1, payload [user1]>}
Package Version
bcrypt 3.2.0 certifi 2022.12.7 cffi 1.14.4 cryptography 38.0.1 netmiko 3.2.0 paramiko 2.7.2 pip 23.0.1 ply 3.11 pyasn1 0.4.8 pycparser 2.20 pycrypto 2.6.1 pycryptodomex 3.15.0 pylzma 0.5.0 PyNaCl 1.4.0 pyOpenSSL 22.1.0 pyserial 3.5 pysmi 0.3.4 pysnmp 4.4.12 PySocks 1.7.1 python-dateutil 2.8.1 pytz 2020.4 pyvmomi 8.0.0.1.2 PyYAML 5.3.1
I tried the solution provided in all the below links, still the issue is not resulved:
https://github.com/etingof/pysnmp/issues/285 (python -c 'from Cryptodome.Cipher import AES')
https://sourceforge.net/p/pysnmp/discussion/46667/thread/623edabb/ (pycrypto was not there I installed and tried)