On Mon, Jul 21, 2003, Markus Lorch wrote: > Hi, > > I frequently have trouble finding function definitions in the crypt > library > e.g. this time I need to take a look at d2i_X509 (e.g. as used by > PEM_read_X509 > to reference the conversion function) > > I've done a "grep -r "d2i_X509" * on the whole crypt source but can't > seem to find the function definition. Is is a macro or something? > Shouldn't I be able to find it somewhere (how does the linker do it?) > How do I find out what code is actually executed when it is called. (I > guess it will eventuall be d2i_X509_BIO but I can't make the connection) > > If you have any tips, hints on how to locate it please let me know >
In OpenSSL 0.9.7 and later just about every ASN1 module is handled by static constant ASN1_ITEM structure. For X509 its &X509_it, though that is hidden from applications. The various functions and definitions are all identical apart from the item it refers to. These functions and definitions are now declared in macros of the form: IMPLEMENT_ASN1_FUNCTIONS(X509) DECLARE_ASN1_FUNCTIONS(X509) in x_x509.c in crypto/asn1 d2i_X509_bio() is similar except its not defined via a macro, it calls ASN1_item_d2i_bio() with the X509 item. -- Dr Stephen N. Henson. Core developer of the OpenSSL project: http://www.openssl.org/ Freelance consultant see: http://www.drh-consultancy.demon.co.uk/ Email: [EMAIL PROTECTED], PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]