1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 17:09:02 +00:00
Files
nmap/nselib/snmp.lua
david 3f7be738ad Allow encoding OID component greater than 127 in snmp.lua. Previously
the code just took each value mod 256 and stored it as a single byte.
The OID 1.3.1000.5 would encode as follows

tag len 1.3 1000%256  5
 06  03  2b       e8 05

What you're supposed to do is break each value into 7-bit chunks, and
set the high bit in every octet but the last. Now it is correctly
encoded as

tag len 1.3 1000  5
 06  04  2b 8768 05

The length also would not have been correct for lengths over 127, and
that is fixed also.
2009-12-14 00:55:05 +00:00

17 KiB