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

DSO support routines and multiple OpenSSL load errors

我想构建一个 OpenSSL RSA 引擎,从 this existing source code file 开始,这是英特尔实现的一种更快的方法。首先,我想构建这段代码,所以我使用这些命令:

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_exp_512 函数的主体。我使用了相同的命令:

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