为openssl构建一个简单的引擎失败了

时间:2013-08-29 09:57:49

标签: c openssl

我刚刚开始开发一个简单的openssl引擎。在这个过程中,我提到了这个不错的网站http://sinodun.com/2009/02/developing-an-engine-for-openssl/

我下载了openssl 1.0.0c并在我自己的文件夹中编译如下:

./config --prefix=/home/workingDir/openssl --openssldir=/home/workingDir/openssl
make
make install

然后我继续复制这个simple_engine.c文件并将其编译为simple_engine.o,然后构建共享库simple_engine.so。

这些可在'workingDir'

中找到

完成这些步骤后,我更改了openssl / apps和openssl1.0.0c / main文件夹下的2个openssl.cnf文件,以便:

openssl_conf            = openssl_def

[openssl_def]
engines = engines_section

[engines_section]
simple = simple_section

[simple_section]
engine_id = simple
dynamic_path = /home/workingDir/simple_engine.so
MODULE_PATH =  /home/workingDir/simple_engine.so
init = 0

[req]
distinguished_name = req_distinguished_name

[req_distinguished_name]

在此之后,我将LD_LIBRARY_PATH设置为指向/ home / workingDir

然后当我做的时候:

./openssl engine

我收到以下错误:

Error configuring OpenSSL
3076019848:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/home/workingDir/simple_engine.so): /home/workingDir/simple_engine.so: undefined symbol: ENGINE_get_static_state
3076019848:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3076019848:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
3076019848:error:260BC066:engine routines:INT_ENGINE_CONFIGURE:engine configuration error:eng_cnf.c:204:section=simple_section, name=dynamic_path, value=/home/workingDir/simple_engine.so
3076019848:error:0E07606D:configuration file routines:MODULE_RUN:module initialization error:conf_mod.c:235:module=engines, value=engines_section, retcode=-1

有什么问题?请帮忙。我无法继续,也没有找到任何文件。

由于

1 个答案:

答案 0 :(得分:0)

问题是openssl.cnf中的MODULE_PATH。当我删除它时,它在使用共享库重新编译openssl后工作!