python-asn1 icon indicating copy to clipboard operation
python-asn1 copied to clipboard

Crashes encoding OIDs starting with 2.999

Open James-E-A opened this issue 2 years ago • 1 comments

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...

James-E-A avatar Dec 01 '23 00:12 James-E-A

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.

andrivet avatar Dec 02 '23 15:12 andrivet