Hi everybody,
I want to use Apache (v1.3.39), mod_ssl (v2.8.30), OpenSSL (v0.9.8y) with a
nCipher card but when I start it, I have the following error message:
[error] OpenSSL: error:81067064:CHIL engine:HWCRHK_INIT:already loaded
[error] OpenSSL: error:260B806D:engine routines:ENGINE_TABLE_REGISTER:init
failed
Thanks to GDB I tried to find why it happens.
First, the error comes from the function "hwcrhk_init": the variable
"hwcrhk_dso" isn't NULL.
As Apache reads the conf twice, this function is called twice and it happens at
the second call.
But between these two calls, "hwcrhk_finish" isn't executed (so "hwcrhk_dso"
isn't freed and not set to NULL).
The call to "hwcrhk_finish" depends of the value of "funct_ref" in the "ENGINE"
structure.
This variable is incremented in "engine_unlocked_init" (where is the call to
"hwcrhk_init") and decremented in "engine_unlocked_finish" (where is the call
to "hwcrhk_finish").
When you look at the calls to these two functions, you see:
* "engine_unlocked_init" => "ENGINE_set_default_[RSA|DH|RAND|...]" and
"ENGINE_get_default_[RSA|DH|RAND|...]" functions
* "engine_unlocked_finish" => "RSA_free" and "DH_free" (no "RAND_free"?)
My conclusion would be: I don't think it's correct to increment "funct_ref"
when the call to "engine_unlocked_init" comes from a "get" function.
So, I'd like to have your help on this problem: if you already know the
solution and / or if you have any idea to continue this analysis (ie. where to
look at).
Thank you in advance,
Clement.