You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ASN1ObjectIdentifier.encode() writes the first sub-identifier as one byte (2.48 → 0x80, 2.999.3 loses a byte) #267
ASN1ObjectIdentifier.encode() writes the first sub-identifier (40 * X + Y) as one byte. When the first arc is 2, Y has no upper bound, so this value can be 128 or more, and then it needs base-128 encoding like the other arcs (X.690 8.19.4). Arcs like this are in use: 2.48 (cybersecurity), 2.49 (alerting), and the example arc 2.999.
ASN1ObjectIdentifier.fromIdentifierString('2.48').encode() // 06 01 80 -> should be 06 02 81 00ASN1ObjectIdentifier.fromIdentifierString('2.999.3').encode() // 06 02 37 03 -> should be 06 03 88 37 03
Decoding is already correct (06 03 88 37 03 → 2.999.3), so a decode → encode round trip changes the OID.
The fix is to run objectIdentifier[0] * 40 + objectIdentifier[1] through the same base-128 loop as the other arcs in lib/asn1/primitives/asn1_object_identifier.dart. For reference, the same bug in asn1lib is wstrange/asn1lib#81. pointycastle 4.0.0.
Activity