Improving the ASN.1 UPER Parser for srsRAN Project #1337
zhouxt1
started this conversation in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The current ASN.1 UPER decoder (for RRC layer) is overly lenient and accepts various non-canonically encoded or invalid messages without raising an error. This can mask interoperability issues with other vendors or non-compliant UEs. For a robust implementation, the decoder should be capable of strictly validating incoming messages against the ASN.1 and UPER specifications.
The following are specific examples of issues observed:
INTEGER Constraints
INTEGER
defined with a value range (e.g.,INTEGER (0..15)
) should only accept values within that range.SIZE Constraints
SEQUENCE OF
orOCTET STRING
with aSIZE
constraint (e.g.,SIZE (1..5)
) must conform to that length constraint.SIZE
range.Invalid Extension Values in Non-Extended Messages
CHOICE
orENUMERATED
type is extended, its extended values can only be used if the parent PDU itself is an extended version (i.e., its extension bit is1
).CHOICE
orENUMERATED
value even when the parent PDU's extension bit is0
. This is because the tag was oveflowed, which points to a non-existant choice, then the parser simply fills it with a choice in the extension, other than rejecting the message.There are also some minor issues, which only matters if the parser is designed to be very strict.
Unconstrained INTEGER Encoding
0x02 0x00 0xFF
instead of the canonical0x01 0xFF
). Similar issue is for length determinant.Explicit Encoding of DEFAULT Values
DEFAULT
value must be absent if its value is the default for a simple type.INTEGER DEFAULT 0
) is explicitly encoded rather than omitted.Empty Extension Groups
1
in the bitmap, but all components within the corresponding extension group are absent, the encoding is non-canonical. The extension bit should have been0
.1
but the extension group is effectively empty.Is the ASN.1 parser designed to be lenient to make it faster, or should it be stricter?
The other question is whether there is any plans to release the ASN.1 compiler as discussed in #55?
Beta Was this translation helpful? Give feedback.
All reactions