On Wed, Sep 15, 2004, Sravan wrote:
> Hi,
> I have been using X509 related functions in my code and for the
> definitions of functions like X509_free( ), I am using the macro
> IMPLEMENT_ASN1_FUNCTIONS(X509). In that macro expansion,
> ASN1_ITEM_rptr(X509) is used which expands to X509_it( ). I couldn't get
> the definition of this function anywhere and so the linker is reporting
> it as an unresloved symbol. Actually I couldn't understand the purpose
> of this ASN1_ITEM_rptr( ). Can anyone please explain me how to get
> around this?
>
> I am using Openssl 0.9.7b in Windows platform.
>
What's the code that causes this error? There are some cases where you might
need to use ASN1_ITEM_rptr() directly but not many.
The reason for that macro (and some related ones) is to do with certain
plaform quirks. In OpenSSL 0.9.7 and later ASN1 modules are defined in terms
of constant structures.
When an external application ASN1 module needs to reference a module inside
OpenSSL itself it has to somehow determine a pointer to the relevant structure.
One some OSes you can't easily reference a pointer to a structure in a shared
library or (in the case of windows) you can't (or I couldn't) initialize a
structure at compile time to contain a pointer to a structure in a shared
library.
That is doing:
const SOME_STRUCT foo = {&bar,...};
where "bar" is in a shared library doesn't work.
The workaround for this is to export functions which return pointers
to the structures instead and include function pointers in the static
structure. The macros are there to allow applications to be
written which use the correct convention on all supported platforms.
Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]