DSO支持例程和多个OpenSSL加载错误

DSO支持例程和多个OpenSSL加载错误,openssl,openssl-engine,Openssl,Openssl Engine,我想构建一个OpenSSL RSA引擎,从它开始,它是由Intel实现的一种更快的方法。首先,我想构建这段代码,因此我使用以下命令: gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o 。

我想构建一个OpenSSL RSA引擎,从它开始,它是由Intel实现的一种更快的方法。首先,我想构建这段代码,因此我使用以下命令:

gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c
gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o
gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c
gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o
。。。没有出现错误。然后,当我尝试使用命令测试引擎时:

openssl engine -t -c `pwd`/eng_rsax.so
。。。我收到以下错误:

140470207960736:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/some_path/eng_rsax.so): /some_path/eng_rsax.so: undefined symbol: mod_exp_512
140470207960736:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140470207960736:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
140470207960736:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:417:id=/some_path/eng_rsax.so
在这一点上,我想我没有使用正确的标志,也许构建引擎的命令不完整。

我需要做什么才能使它工作?

为了使它工作,我刚刚在第260行通过添加
{}
而不是
,实现了
mod\u exp\u 512
函数体。我使用了相同的命令:

gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c
gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o
gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c
gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o

看起来部分是路径问题。也许你可以
LD_LIBRARY_PATH=“$(pwd):LD_LIBRARY_PATH”openssl引擎-t-c
pwd
/eng_rsax。因此
感谢你的评论,但错误仍然存在。