I just tested, whether the BER-encoding is preserved if I do not alter
any of the contents. Unfortunately, it seems as if the encoding is not
preserved. I did the following:

d2i_PKCS7_bio(file, &p7);

and then directly

i2d_PKCS7_bio(file2, p7);

again. "file" was BER-encoded using e.g. an Octet String in
constructed form with inifinite length, which was DER-encoded in
primitive form using definite length in the output.
Is there a way how I can circumvent the reencoding?

Best regards,
Martin

(BTW: I'm using 0.9.8o, maybe it's different in 1.0.0?)

2010/11/6 Martin Boßlet <martin.boss...@googlemail.com>:
> Thanks for this, I'll have a look at the streaming features then!
>
> Best regards,
> Martin
>
> 2010/11/6 Dr. Stephen Henson <st...@openssl.org>:
>> On Fri, Nov 05, 2010, Martin Bolet wrote:
>>
>>> I'm sorry, I was not precise here. Actually I think (have to verify it
>>> again though) the encoding is preserved if I parse the
>>> EncapContentInfo and reencode it later on without changing the
>>> content.
>>>
>>> My problem was more the other way round: When creating an
>>> EncapContentInfo from scratch, can I force to use indefinite length
>>> instead of the DER definite length bytes?
>>>
>>
>> Well OpenSSL uses DER for almost everything so for most cases you can't use
>> indefinite length encoding.
>>
>> An exception is when you stream content in OpenSSL 1.0.0: then the relevant
>> structures use indefinite length constructed encoding.
>>
>> Steve.
>> --
>> Dr Stephen N. Henson. OpenSSL project core developer.
>> Commercial tech support now available see: http://www.openssl.org
>> ______________________________________________________________________
>> OpenSSL Project                                 http://www.openssl.org
>> User Support Mailing List                    openssl-us...@openssl.org
>> Automated List Manager                           majord...@openssl.org
>>
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to