-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hi, I have encountered a problem with the length determinant check in Open Type when they include types with extensions in UPER. Suppose we have the following ASN.1 definition,
S1 ::= SEQUENCE {
t0 SEQUENCE {
e1 BOOLEAN,
...,
[[ e2 S2 OPTIONAL ]]
},
t1 BOOLEAN
}
S2 ::= SEQUENCE {
t0 BOOLEAN,
...,
t1 BOOLEAN OPTIONAL
}
And a correct encoding for the value v0 = {"t0" : {"e1" : True, "e2" : {"t0" : True}}, "t1" : True} should be c0406820. But if we alter the encoding's field for the length determinant of the extension group containing e2, and feed it back to the decoder, it would not run into a length determinant error (which it should). Say we provide an input of c040a82000 (the change is shown below), pycrate will still accept the message and decode it back to v0 (here some zero paddings are needed for the incorrect encoding).
1 | 1 | 0000000 | 1 | 00000001 | xxxxxxxx | 1
10
Is there any problem with the length determinant checking process?
Thank you.