An issue has arisen with Windows DLLs and the new ASN1 code...

The new ASN1 code declares its ASN1 modules in terms of constant
structures called ASN1_ITEM. The i2d, d2i, free and new operations are
now declared as wrapper functions which call a high level ASN1_item_*()
function and include a pointer to the relevant ASN1_ITEM as an argument.

Anyway, internally this isn't a problem. However if you want to write
your own ASN1 modules (which is now vastly easier) you need to be able
reference these ASN1_ITEM structures, which may be in a shared library.

Some platforms like Linux seem to handle this totally transparently and
you don't notice the difference. Windows however is another matter
entirely.

AFAICS this needs a "DATA" declaration in the DEF file *and* a custom
header declaration otherwise it doesn't work (linker errors or invalid
data).

The header declaration is where things get more interesting. When
compiling code that is going to be linked into the DLL you need to
precede the variable with: 

_declspec( dllexport )

however when linking to these variables you need:

_declspec( dllimport )

So the declaration needs to be different according to whether the DLL
code is being compiled or linked to. 

You can add an additional complication that the external "application"
may itself be a DLL which may need to export the stuff at compile time
and have the import declaration when linking to further applications.

I can think of several possible solutions such as adding something to an
internal only header like cryptlib.h or adding a compilation option to
the Win32 Makefile when the OpenSSL DLLs are being compiled. 

Any thoughts? 

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to