通过OpenSSL.conf文件加载OpenSSL自定义引擎显示错误

通过OpenSSL.conf文件加载OpenSSL自定义引擎显示错误,openssl,openssl-engine,Openssl,Openssl Engine,我有一个简单的openssl引擎,我想通过openssl.conf文件将其加载到openssl中。我已使用以下配置设置从源代码处安装了openssl-1.1.1c ./config--prefix=/opt/openssl-DOPENSSL_LOAD_CONF--openssldir=/opt/openssl 安装后,$openssl版本显示以下内容: ss@ss:~$ openssl version OpenSSL 1.1.1c 28 May 2019 openssl_conf = ope

我有一个简单的openssl引擎,我想通过
openssl.conf
文件将其加载到openssl中。我已使用以下配置设置从源代码处安装了
openssl-1.1.1c

./config--prefix=/opt/openssl-DOPENSSL_LOAD_CONF--openssldir=/opt/openssl

安装后,
$openssl版本
显示以下内容:

ss@ss:~$ openssl version
OpenSSL 1.1.1c  28 May 2019
openssl_conf = openssl_def

[openssl_def]
engines = engine_section

[engine_section]
rsa-engine-new = rsa_section

[rsa_section]
engine_id = rsa-engine-new
ss@ss:/opt/openssl$ openssl engine
rsa-engine-new
(rdrand) Intel RDRAND engine
(dynamic) Dynamic engine loading support
(rsa-engine-new) engine for testing 1
139904801769216:error:260AB089:engine routines:ENGINE_ctrl_cmd_string:invalid cmd name:crypto/engine/eng_ctrl.c:255:
139904801769216:error:260BC066:engine routines:int_engine_configure:engine configuration error:crypto/engine/eng_cnf.c:141:section=rsa_section, name=oid_section, value=new_oids
139904801769216:error:0E07606D:configuration file routines:module_run:module initialization error:crypto/conf/conf_mod.c:177:module=engines, value=engine_section, retcode=-1      
之后,我更改
openssl.conf
如下所示

ss@ss:~$ openssl version
OpenSSL 1.1.1c  28 May 2019
openssl_conf = openssl_def

[openssl_def]
engines = engine_section

[engine_section]
rsa-engine-new = rsa_section

[rsa_section]
engine_id = rsa-engine-new
ss@ss:/opt/openssl$ openssl engine
rsa-engine-new
(rdrand) Intel RDRAND engine
(dynamic) Dynamic engine loading support
(rsa-engine-new) engine for testing 1
139904801769216:error:260AB089:engine routines:ENGINE_ctrl_cmd_string:invalid cmd name:crypto/engine/eng_ctrl.c:255:
139904801769216:error:260BC066:engine routines:int_engine_configure:engine configuration error:crypto/engine/eng_cnf.c:141:section=rsa_section, name=oid_section, value=new_oids
139904801769216:error:0E07606D:configuration file routines:module_run:module initialization error:crypto/conf/conf_mod.c:177:module=engines, value=engine_section, retcode=-1      
进行这些更改后,
openssl引擎
命令显示以下内容:

ss@ss:~$ openssl version
OpenSSL 1.1.1c  28 May 2019
openssl_conf = openssl_def

[openssl_def]
engines = engine_section

[engine_section]
rsa-engine-new = rsa_section

[rsa_section]
engine_id = rsa-engine-new
ss@ss:/opt/openssl$ openssl engine
rsa-engine-new
(rdrand) Intel RDRAND engine
(dynamic) Dynamic engine loading support
(rsa-engine-new) engine for testing 1
139904801769216:error:260AB089:engine routines:ENGINE_ctrl_cmd_string:invalid cmd name:crypto/engine/eng_ctrl.c:255:
139904801769216:error:260BC066:engine routines:int_engine_configure:engine configuration error:crypto/engine/eng_cnf.c:141:section=rsa_section, name=oid_section, value=new_oids
139904801769216:error:0E07606D:configuration file routines:module_run:module initialization error:crypto/conf/conf_mod.c:177:module=engines, value=engine_section, retcode=-1      

知道我做错了什么吗?

您的RSA引擎的源代码中可能有一些错误。请关注第一条错误消息。@DaniGrosu,谢谢您的回复。对于我的引擎,我只尝试提供描述服务。我想知道OpenSSL引擎中是否需要实现一组公共功能,即使我的意图是只提供引擎的解密服务?我想我是在问OpenSSL引擎是否有一个通用的结构框架?@DaniGrosu,你能提供RSA引擎的基本结构吗?我从一开始就遵循同样的结构。这是我的基本引擎结构。我是添加了所有内容还是需要添加
!引擎设置销毁功能(e,数据同步销毁)
!引擎设置初始化函数(e,dasync初始化)
!发动机设置完成功能(e,数据同步完成)
是否也可以?