[erlang-questions] ASN.1 PER Does Not Correctly Handle Value Range Size Constraint

Behdad Forghani behdad.forghani@REDACTED
Sat May 21 21:35:09 CEST 2011


Hi,

I have tested this on R14B02.

I noticed that ASN.1 compiler does not handle value range size 
constraints for SEQUENCE OF and BIT STRING.

For example:
Abs ::= BIT STRING(0|1|7)
Bbs ::= BIT STRING(3..18)
Cbs ::= BIT STRING


Abs has a size constraint of 0..7 and Bbs, 3..18.

All three of the above will be encoded identically as length 
indeterminant as 0x07DA. This is only correct for Cbs. The problem seems 
to be that encode_bit_string calls get_constraint(C,'SizeConstraint').

However the constraint for the Abs is a UNION and for Bbs a ValueRange. 
It seems to me the support for both constraints needs to be added.

Just FYI, trying to give something back to the community. If I am 
correct, I can easily fix it. In that case, can you enlighten me on how 
to submit my code changes?

Behdad



More information about the erlang-questions mailing list