2013-08-29 72 views
1

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

这些在 '工作目录'

这些步骤后发现,我换了2 openssl.cnf中可用的文件下的OpenSSL /应用程序和openssl1.0.0c /主文件夹,这样的:

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 /工作目录

后来,当我做:

./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

我猜你的自定义openssl没有找到它自己的libcrypto.so和libssl.so。他们在哪里安装?如果还不是这种情况,你可以尝试将它们的位置添加到LD_LIBRARY_PATH中吗?您的链接中的示例适用于我的发行版的openssl。 –

+0

我的自定义openssl不构建这些共享库。只有静态的可用。 – user900785

+0

好吧,我用shared选项重新编译了我的openssl1.0.0c。现在我有一个lib文件夹,它有ssl和加密共享库。除了所有引擎共享库之外,还有一个引擎文件夹。我的openssl本身不是'习惯'的。我所做的只是将openssl.cnf文件更改为指向编译后的simple_engine.so所在的文件夹.LD_LIBRARY_PATH指向哪? – user900785

回答

0

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