>From: owner-openssl-us...@openssl.org On Behalf Of Mitchell, Daniel F
>Sent: Tuesday, 23 October, 2012 15:05

>I am trying to use openssl in a Windows DLL.  However, on the first 
>openssl call I make after these:

>CRYPTO_malloc_init();

>OpenSSL_add_all_algorithms();

>I get the "no OPENSSL_Applink" error.  I read the FAQ, and I have 
>compiled with /MD, I have included applink.c in my code (and it is 
>a c program, so no extern), and I have the latest versions of 
>libeay32.dll, libssl32.dll, and ssleay32.dll in the sys32 folder, 

Aside: The openssl libraries on Windows are libeay32 and ssleay32.
I don't know what libssl32 is.

>where my dll is.  My dll is being called by a windows executable, 
>so I don't know if that could have anything to do with it, since 
>I have no real control over that.

This probably doesn't work. The code for "uplink" looks to me 
like it looks for _Applink ONLY in the .exe. 

If you supply your library to be *static* linked with the app 
it should work, but you get all the features of static linking, 
good and bad -- bigger .exe (rarely matters nowadays); 
possible name conflicts; can't update separately.

Otherwise you must avoid all openssl calls that use uplink/applink;
basically this is anything that uses a FILE* opened by your program.
If you handle the file I/O yourself -- for example, read a DER cert 
file into memory and call d2i_X509 instead of opening the file 
and calling d2i_X509_fp, OR you have openssl *open* the files 
by explicitly calling BIO_new_file or equivalent and using the BIO* 
instead of using any FILE*, it should be okay.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to