-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
area/codecRelated to a new or existing ASN.1 codec.Related to a new or existing ASN.1 codec.good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededkind/bugSomething isn't workingSomething isn't working
Description
Hi, I find that the handling of normally small length determinants might be incorrect in UPER.
Notably, in /per/de.rs,
// The length bitfield has a lower bound of `1..`
let extensions_length = self.parse_normally_small_integer::<usize>()? + 1;
let (input, bitfield) = nom::bytes::streaming::take(extensions_length)(self.input)
.map_err(|e| DecodeError::map_nom_err(e, self.codec()))?;
self.input = input;It uses a parse_normally_small_integer. However, the standard says you should decode a normally small length (X.691 Section 11.9.3.4) when parsing the number of extensions, and this normally small length is different from a normally small non-negative whole number.
Notably, when normally small length's first bit is 1, it is encoded as a length determinant, but for the function parse_normally_small_integer, it is parsed as a non-negative whole number, which is wrong. So the parsed value would be incorrect.
Could you look into this potential non-compilance issue? Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/codecRelated to a new or existing ASN.1 codec.Related to a new or existing ASN.1 codec.good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededkind/bugSomething isn't workingSomething isn't working