help-libtasn1
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: streaming decoding


From: Simon Josefsson
Subject: Re: streaming decoding
Date: Tue, 20 Sep 2011 16:55:33 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

Dmitriy Anisimkov <address@hidden> writes:

> On 08/12/2011 11:41 AM, Dmitriy Anisimkov wrote:
>> Is there way to decode binary stream with indefinite number of ASN.1
>> defined records ?
>>
>
> To know the record length I have to use asn1_get_tag_der and
> asn1_get_length_ber.

That is a good solution, thanks for sharing.

> The better way would be if function asn1_der_decoding (or any similar
> new one) returned the decoded record length.

I don't think so -- that function shouldn't have to guess where data
ends.  It seems better for the function to take the correct length as
input, and return an error if the decoded data appears to be shorter or
longer (corrupted) instead.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]