forked from pool/python-pysnmp
* Fixed SNMP engine ID generation on Windows. * SNMPv3 crypto operations that require external dependencies made dependent on the optional external package -- pysnmpcrypto. * Added Slim class and simplified some examples. * Fixed a #SNMP demo compatibility issue. * Fixed passwordToKeySHA. * Enabled Python 3.11 support. * Switched to pyasn1/pyasn1 package. * Removed legacy paddings in v3 packets. * Changed web site to pysnmp.com. * Inherited all changes made by Splunk team. - Switch to pyproject macros. - Add patch support-new-pyasn1.patch: * Support pyasn1 0.5.0. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysnmp?expand=0&rev=49
42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
Index: pysnmp-5.0.28/pysnmp/proto/api/verdec.py
|
|
===================================================================
|
|
--- pysnmp-5.0.28.orig/pysnmp/proto/api/verdec.py
|
|
+++ pysnmp-5.0.28/pysnmp/proto/api/verdec.py
|
|
@@ -6,19 +6,20 @@
|
|
#
|
|
from pyasn1.type import univ
|
|
from pyasn1.codec.ber import decoder, eoo
|
|
+from pyasn1.codec.streaming import readFromStream
|
|
from pyasn1.error import PyAsn1Error
|
|
from pysnmp.proto.error import ProtocolError
|
|
|
|
|
|
def decodeMessageVersion(wholeMsg):
|
|
try:
|
|
- seq, wholeMsg = decoder.decode(
|
|
+ wholeMsg, seq = decoder.decode(
|
|
wholeMsg, asn1Spec=univ.Sequence(),
|
|
- recursiveFlag=False, substrateFun=lambda a, b, c: (a, b[:c])
|
|
+ recursiveFlag=False, substrateFun=lambda a, b, c, d: readFromStream(b, c)
|
|
)
|
|
ver, wholeMsg = decoder.decode(
|
|
wholeMsg, asn1Spec=univ.Integer(),
|
|
- recursiveFlag=False, substrateFun=lambda a, b, c: (a, b[:c])
|
|
+ recursiveFlag=False, substrateFun=lambda a, b, c, d: readFromStream(b, c)
|
|
)
|
|
if eoo.endOfOctets.isSameTypeWith(ver):
|
|
raise ProtocolError('EOO at SNMP version component')
|
|
Index: pysnmp-5.0.28/pyproject.toml
|
|
===================================================================
|
|
--- pysnmp-5.0.28.orig/pyproject.toml
|
|
+++ pysnmp-5.0.28/pyproject.toml
|
|
@@ -27,7 +27,7 @@ include = ["docs", "tests", "examples"]
|
|
|
|
[tool.poetry.dependencies]
|
|
python = "^3.7"
|
|
-pyasn1 = ">=0.4.8, <0.5.0"
|
|
+pyasn1 = "^0.5.0"
|
|
pysnmpcrypto = "^0.0.4"
|
|
pysmi-lextudio = "^1.0.4"
|
|
|