Hi,
If the 0x80 byte is taken as length rather than as value (as I have
taken in my interpretation of the bytes), then there is still a problem
with the byte stream, since the length of the result field here is 0x6,
not 0x8.
From Olivier Dubuisson's book, fields within a structure are implicitly
tagged. Making use of that here, the tag should not be put for the
'parameter' field. The only point of debate is whether I am correct or
not in deriving the length of the octet string as
(size of encoding for structure - number of bytes read so far)
If I am wrong, then the size of the structure is wrongly given as 0x06.
If I am write, I would like to know how to handle the additional 2 bytes
filled with 0 that are a part of the ReturnResult structure encoding.
Hope what I've written makes some sense.
Btw, if I look at the intention of the tool that's sending me this byte
stream, then the decoding that's happening is correct, except for the
handling of those 2 bytes.
Regds,
Divya
PS: To reiterate, the decoding I am doing is as follows:
0xa2: Tag for ReturnResult structure within Component (CNTX, CONS, 2)
0x0d: Length of the contents = 13 bytes
0x02: Integer tag (for invokeID)
0x01: Length of the contents = 1 byte
0x00: Value of invokeID = 0
0x30: Sequence tag (for result)
0x06: Length of the contents = 6 bytes
0x02: Integer tag (for localValue within operationCode)
0x01: Length of the contents = 1 byte
0x0e: Value of localValue = 0x0e
Assumed tag (UNIV, PRIM, OCTETSTRING_TAG_CODE) and length of
6 - 3 = 3 bytes
0x80: parameter[0]
0x01: parameter[1]
0x04: parameter[2]
The structure I am looking at is Component, where it is defined as:
Component ::= CHOICE {
invoke [1] IMPLICIT Invoke,
returnResultLast [2] IMPLICIT ReturnResult,
returnError [3] IMPLICIT ReturnError,
reject [4] IMPLICIT Reject,
returnResultNotLast [7] IMPLICIT ReturnResult
}
ReturnResult ::= SEQUENCE {
invokeID INTEGER (-128..127),
result SEQUENCE {
operationCode CHOICE {
localValue INTEGER,
globalValue OBJECT IDENTIFIER
},
parameter OCTET STRING (SIZE(1..255))
} OPTIONAL
}
Vishal wrote ---
> Hi Divya,
>
>
>
> The 2 null bytes (0x00) at the end are, may be, indicating end of contents
> for some parameter.
>
> Are you sure there is no length field for some parameter, before the
> bytes
> you have sent, in which length is specified as EOC-encoded.
>
>
>
> Thanks and Best Regards,
>
> Vishal.
"SASKEN RATED THE BEST EMPLOYER IN THE COUNTRY by the BUSINESS TODAY Mercer
Survey 2004"
SASKEN BUSINESS DISCLAIMER
This message may contain confidential, proprietary or legally Privileged
information. In case you are not the original intended Recipient of the
message, you must not, directly or indirectly, use, Disclose, distribute,
print, or copy any part of this message and you are requested to delete it and
inform the sender. Any views expressed in this message are those of the
individual sender unless otherwise stated. Nothing contained in this message
shall be construed as an offer or acceptance of any offer by Sasken
Communication Technologies Limited ("Sasken") unless sent with that express
intent and with due authority of Sasken. Sasken has taken enough precautions to
prevent the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email
_______________________________________________
ASN1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1