Hello<br>I found situation when ASN.1 runtime encoder does not check constraint:<br><br>The Number defined in StructA.asn as:<br><br>Number ::= OCTET STRING (SIZE(minNumberLength..maxNumberLength))<br>minNumberLength INTEGER ::= 1<br>
maxNumberLength INTEGER ::= 5<br><br><br>Then in StructB.asn Number is imported, and used as:<br><br>Data ::= SEQUENCE<br>{<br> version [0] INTEGER,<br> number [1] Number<br>}<br><br>So, after compilation of this two asn-files we have encoder module for StructB, but this encoder does not check Number size constraint:<br>
<br>1> 'StructB':encode('Data', {'Data', 1, "34"}).<br>{ok,[48,7,128,1,1,129,2,51,52]}<br>2> 'StructB':encode('Data', {'Data', 1, ""}).<br>{ok,[48,5,128,1,1,129,0]}<br>
3> 'StructB':encode('Data', {'Data', 1, "3444455555554"}).<br>{ok,[48,18,128,1,1,129,13,51,52,52,52,52,53,53,53,53,53,53, 53,52]}<br><br><br>Thank you<br><br>-- <br>Maxim Treskin<br>