Hello,

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.

openssl engine dynamic -pre SO_PATH:/usr/lib/dyn_cluster_labs.so -pre ID:cluster_labs 
-pre LOAD

The log of this command is the following:

        (dynamic) Dynamic engine loading support
        cmd = 200
        i   = 0
        p   = /usr/lib/dyn_cluster_labs.so
        [Success]: SO_PATH:/usr/lib/dyn_cluster_labs.so
        cmd = 202
        i   = 0
        p   = cluster_labs
        [Success]: ID:cluster_labs
        cmd = 204
        i   = 0
        p   = (null)
        [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:

        #ifdef ENGINE_DYNAMIC_SUPPORT
        static int bind_fn(ENGINE *e, const char *id)
                {
                if(id && (strcmp(id, engine_cluster_labs_id) != 0))
                        return 0;
                if(!bind_helper(e))
                        return 0;
                return 1;
                }
        IMPLEMENT_DYNAMIC_CHECK_FN()
        IMPLEMENT_DYNAMIC_BIND_FN(bind_fn)
        #endif /* ENGINE_DYNAMIC_SUPPORT */

Is there  a general error in the allocation process or is this only in my code? I have 
tested this 
with the beta2 of openssl-0.9.7.

Jan

____________________________________________________________________

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 \
        

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to