2013-08-29 71 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之後起作用!