Fix. Decode Unsigned Values as Unsigned#215
Fix. Decode Unsigned Values as Unsigned#215nigredon1991 wants to merge 1 commit intoetingof:masterfrom
Conversation
Fix some issues in pysnmp etingof/pysnmp#190 etingof/pysnmp#357 etingof/pysnmp#384
|
The value that you decode in the example - '4104985D4B44': leaving the type(41) and the len(04) aside the highest bit of the actual value (985D4B44) is 1. Doesn't that require to handle it as a 2s-complement? because Snmp uses ASN.1/BER and ASN.1 knows signed integer only? In that case the exception would be correct because the server actually used an incorrect encoding and sent a negative number (that's at least my current understanding, also https://pysnmp.readthedocs.io/en/latest/faq/ignored-snmp-packets.html). |
|
This behavior is wrong, I'll try to refer to the answer of another person who has already answered quite fully |
|
Since the ecosystem moved away from here, you should send your pull request to https://github.com/pyasn1/pyasn1. |
Fix some issues in pysnmp
etingof/pysnmp#190
etingof/pysnmp#357
etingof/pysnmp#384
Example for fast test:
On the current master, it will fall into a ValueConstraintError:
And after correction it is correctly decoded: