1

我刚刚开始开发一个简单的 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/ 主文件夹下的 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

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

谢谢

4

1 回答 1

0

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

于 2013-09-19T13:54:48.323 回答