python-asn1
python-asn1 copied to clipboard
Crashes encoding OIDs starting with 2.999
https://lapo.it/asn1js/#060488378952
https://www.oid-info.com/get/2.999
import asn1
assert asn1.__version__ == '2.7.0'
e = asn1.Encoder()
e.start()
e.write('2.999.1234', asn1.Numbers.ObjectIdentifier) # fails on this line
# asn1.Error: Illegal object identifier
result = e.output()
if result != bytes.fromhex('060488378952'):
raise AssertionError("fail") # we never even get this far...
It does not "crash" but raises an error because the library considered the OID as invalid. At this stage, it is not clear for me if OID starting with 2.999 are indeed valid. I would say no, but I will have to look at this further.