You are here

ASN.1 decoding rule for length field as zero and no data

3 posts / 0 new
Last post
satish692
ASN.1 decoding rule for length field as zero and no data

Hi,

This is regarding ASN.1 decoding rules for integer type. I receive a message from network with proper TAG value, length field as 00 and no data, (TAG = 0x92 , Length = 0x00).
Is it right to decode this parameter and indicate application (MAP/IS41 User) that this parameter is present and data is 0x00....?

The other two options can be:
1) Reject the message
2) without rejecting the message, indicate to application that this parameter(with length=0) is not present

I did a search in the ASN.1 specifications regarding this, but they do not mention the handling of such scenario...

Edited by: admin on 05/16/2010 - 04:32
dineshonss7
Re: ASN.1 decoding rule for length field as zero and no data

I think you can encode only NULL TAG in this fashion which you have mentioned , for other TAG encoding rules are defined,
For boolean it is clearly defined that the length should be one octet to mentioned the value 0 or 1.

According to me if it is not NULL TAG , it violates the BER encoding rule and messages could be rejected.

dineshonss7
Re: ASN.1 decoding rule for length field as zero and no data

wants to add more information,

If it is Sequence OF with iteration count of zero would encode with an L of zero.
Similarly a SEQUENCE, all of whose elements were optional, and which in an instance of communication were all missing, would again encode with an L of zero.