Menu

#49 Constrained BIT STRING Value Incorrectly Parsed

open
nobody
None
5
2008-02-10
2008-02-10
cinimod
No

Running asn1c -EF on

Type4 ::= BIT STRING (SIZE (4..4)) (SIZE (4..4)) (SIZE (4..4))
value4 Type4 ::= '1000'B

gives

Type4 ::= BIT STRING (SIZE(4..4))(SIZE(4..4))(SIZE(4..4))

value4 Type4 ::= '1'B

The full module is given below.

FooBar {1 2 3 4 5 6} DEFINITIONS ::=
BEGIN
Type1 ::= SEQUENCE {element0 SEQUENCE {}}
value1 Type1 ::= {element0 {}}
Type2 ::= SEQUENCE {element1 BIT STRING}
value2 Type2 ::= {element1 '01'B}
Type3 ::= INTEGER
value3 Type3 ::= -1
Type4 ::= BIT STRING (SIZE (4..4)) (SIZE (4..4)) (SIZE (4..4))
value4 Type4 ::= '1000'B
Type5 ::= CHOICE {element2 INTEGER}
value5 Type5 ::= element2:-2
Type6 ::= SEQUENCE {element3 SEQUENCE {element4 SEQUENCE {},
element5 CHOICE {element6 INTEGER},
element7 SEQUENCE {},
element8 SEQUENCE {element9 BIT STRING (SIZE (6..11)) (S
IZE (6..9)) (SIZE (8..8))}},
element10 SEQUENCE {}}
value6 Type6 ::= {element3 {element4 {},
element5 element6:6,
element7 {},
element8 {element9 '01000001'B}},
element10 {}}
Type7 ::= INTEGER
value7 Type7 ::= 0
Type8 ::= SEQUENCE {}
value8 Type8 ::= {}
Type9 ::= SEQUENCE {}
value9 Type9 ::= {}
Type10 ::= INTEGER
value10 Type10 ::= -3
END

Discussion


Log in to post a comment.