On Tue, Jul 01, 2008, harold reggie wrote:

> Hello,
> I am trying to build a custom asn1 structure in my program using openssl
> 0.9.6.
> The structure will have a few sequences / sets with integers,
> printablestrings, etc.
> I am looking for some help on where to begin. I have been pouring over the
> openssl code, and have been playing with various methods of creating this
> ans1 structure but i haven't been able to create quite what i need.
> Are there some good examples out there too look at?

The first piece of advice if possible is DON'T. The ASN1 code changed
significantly in OpenSSL 0.9.7 and later and as a result it is much easier to
write. All the old code had been rewritten in the new format with the odd
exception such as SSL_SESSION.

In 0.9.7 there are numerous cases where the standard modules use ASN1 these
usually have the names *_asn1.c or *_asn.c . There are many (which don't
follow that naming convention) in crypto/x509v3.

If you have to use 0.9.6 then look at the equivalent files. You have to
manually write 4 functions foo_new(), foo_free(), i2d_foo() and d2i_foo()
using macros from asn1_mac.h .

Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org