On 2005.10.19 at 19:26:36 +0200, Steffen Pankratz wrote:

> Hi
> 
> I'm trying to get my dynamic engine to work on windows (openssl 0.9.8a, ms 
> vc++ 7)
> it runs fine in linux

Have you configured openssl with right way when building? 
Check openssl include files you are using when compiling for definition
of OPENSSL_NO_DYNAMIC_ENGINE macro. It should be in opensslconf.h
If it is there, you have to run 

perl Configure VC-WIN32 shared 

and rebuild openssl as described in INSTALL.W32

> ----schnip------
> 
> #ifndef OPENSSL_NO_DYNAMIC_ENGINE
> static int bind_helper(ENGINE *e, const char *id)
> {
> if(id && (strcmp(id, engine_desecb_id) != 0))
> return 0;
> if(!bind_desecb(e))
> return 0;
> return 1;
> }       

> IMPLEMENT_DYNAMIC_CHECK_FN()
> IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)

Note that on Windows one have to add export declaration before both of
these macros. Otherwise functions, implemented by these macros wouldn't
be exported from DLL and openssl would be unable to load engine
dynamically.

I have following code in my engine which loads successfully under Win32:

#ifdef _WIN32
extern __declspec( dllexport ) 
#endif
    
IMPLEMENT_DYNAMIC_BIND_FN(bind_gost);
#ifdef _WIN32
extern __declspec( dllexport ) 
#endif
IMPLEMENT_DYNAMIC_CHECK_FN();

Symbol _WIN32 is defined automagically by all Win32 compilers I've
tested (gcc/mingw32, gcc cross-compiler on Linix, various versions of
Borland, starting with 4.x, MSVC )


> 
> so i tricked and did a #undef OPENSSL_NO_DYNAMIC_ENGINE
> but i can't load my dll in openssl at all
> 
> C:\Dokumente und Einstellungen\kratz00>openssl engine -vvvv dynamic -pre 
> "SO_PATH:C:\Dokumente und Einstellungen\kratz00\Eigene Dateien\Visual Studio 
> Projects\dlltest2\Debug\dlltest2.dll" -pre LOAD
> (dynamic) Dynamic engine loading support
> [Success]: SO_PATH:C:\Dokumente und Einstellungen\kratz00\Eigene 
> Dateien\VisualStudio Projects\dlltest2\Debug\dlltest2.dll
> [Failure]: LOAD
> 1720:error:2507606A:DSO support routines:WIN32_BIND_FUNC:could not bind to 
> the requested symbol name:.\crypto\dso\dso_win32.c:288:symname(bind_engine)

This error looks much like DLL symbol export problem described above

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to