> [[email protected] - Thu Jan 05 14:38:04 2012]:
> 
> Hello all:
> 
> While playing around with a project over the holidays, I ran into the
> following:
> 
> If you have an Optional Implicitly tagged GENERAL_NAMES, followed by
> another optional implicitly tagged item, and you don't actually fill
> in the GENERAL_NAMES structure (since it is optional), OpenSSL will
> fail to properly DER encode the structure.
> 

That's a current limitation in the way item templates are passed
parameters. It isn't usually a problem in practice because you can get
the same structures by avoiding the item template. For example:

> 
> ASN1_SEQUENCE(FOO) = {
>    ASN1_SIMPLE(FOO, obj, ASN1_OBJECT),
>    ASN1_IMP_OPT(FOO, names, GENERAL_NAMES, 0),
>    ASN1_IMP_OPT(FOO, nonce, ASN1_OCTET_STRING, 1),
> } ASN1_SEQUENCE_END(FOO)
> 
> IMPLEMENT_ASN1_FUNCTIONS(FOO)
> 

If you used:

 ASN1_IMP_SEQUENCE_OF_OPT(FOO, names, GENERAL_NAME, 0),

it should work OK.

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
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to