Hello Geoff,
I'm working with an i386 platform with an RedHat installed and here is the script I
use to build the
dynamic engine library.
______________________________________________________________________
#! /bin/sh
cd crypto/engine
gcc -I.. -I../.. -I../../include -fPIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
-DHAVE_DLFCN_H
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer
-mcpu=pentium -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DENGINE_DYNAMIC_SUPPORT
-c -o hw_cluster_labs_dyn.o hw_cluster_labs.c
mv hw_cluster_labs_dyn.o ../../
cd ../..
gcc -shared -o dyn_cluster_labs.so hw_cluster_labs_dyn.o -L. -lcrypto
#gcc -o dyn_cluster_labs.so hw_cluster_labs_dyn.o libcrypto.a
cp dyn_cluster_labs.so /usr/lib/
______________________________________________________________________
I have done this for the atalla too, but with the same result.
I have tried to link with the crypto.a but the same.
Jan
Geoff Thorpe wrote:
> Hi Jan,
>
> On Mon, 8 Jul 2002, Jan Tschirschwitz wrote:
>
>
>>I want to implement our engine in a dynamic way. I have build an dynamic
>>engine library. When I want to load this library with this command I get
>>an error during the engine bind process.
>>
>
> [snip]
>
>
>> [Failure]: LOAD
>> 18559:error:260B606D:engine routines:DYNAMIC_LOAD:init failed:eng_dyn.c:428:
>>
>>I have seen that this error is caused by the function macro
>>"IMPLEMENT_DYNAMIC_BIND_FN" in engine.h. The command
>>"CRYPTO_set_mem_functions" returns with zero because "allow_customize"
>>is zero. I have called this function macro in the dynamic library with:
>>
>
> hmm, ouch. It would help to know
>
> (a) which platform are you working with?
> (b) how did you compile and link the DSO version of your engine
> implementation?
>
> I suspect the answer to your problem is probably linking. The first
> function called by the IMPLEMENT_DYNAMIC_BIND_FN()-generated code is
> CRYPTO_set_mem_functions(), so if that's failing because allow_customize
> has already been set to zero it means one of two things;
> (i) something in your DSO had already called malloc(),free(),etc
> (ii) the loading of your DSO caused the DSO to resolve symbols against
> the code loading it rather than internally to itself.
>
> I doubt it's (i) because this is happening at a point where your DSO
> hasn't really had a chance to do anything else. So I suspect the problem
> is that your shared-library ENGINE does not load and run with its own
> "copy" of the malloc callbacks and/or memory management functions but is
> instead being resolved to use the copies from the openssl code that is
> loading the DSO. Can you try re-linking your ENGINE shared-library with
> whatever flags are appropriate to your platform to force the
> shared-library to statically link in the code it needs from libcrypto.a.
> NB: You should probably avoid using a shared-library version of openssl,
> just in case that's what you were doing.
>
>
>>____________________________________________________________________
>>
>>Ps: I have seen some small errors in the README.ENGINE
>>
>>instead of:
>> openssl engine dynamic \
>> -pre SO_PATH:/lib/libfoo.so \
>> -pre ENGINE_ID:foo \
>> -pre LOAD \
>> -pre "CMD_FOO:some input data"
>>
>> must be:
>> -pre ID:foo \
>>
>
> Cool, thanks - I'll change that.
>
> Cheers,
> Geoff
>
>
> ______________________________________________________________________
> OpenSSL Project http://www.openssl.org
> Development Mailing List [EMAIL PROTECTED]
> Automated List Manager [EMAIL PROTECTED]
>
>
--
------------------------------------------------------------------------
We have moved to a new location on April, 26th, 2002:
Potsdamer Stra�e 88 . 10785 Berlin
------------------------------------------------------------------------
[EMAIL PROTECTED]
Software Development
Cluster Labs GmbH
Potsdamer Strasse 88
10785 Berlin
Germany
Tel: +49-30-306940-52 Fax: +49-30-306940-31
PGP ID: 0xCDC217EC
PGP Fingerprint: FB87 E16D 8CCF 2A1C 440B C639 3B4F E31E CDC2 17E
----------------------------------------------------------------------
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]