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]