openssl - 通过 openssl.conf 文件加载 OpenSSL 自定义引擎显示错误
问题描述
我有一个简单的 openssl 引擎,我想通过openssl.conf
文件加载到 OpenSSL 中。我openssl-1.1.1c
使用以下配置设置从源代码安装,
./config --prefix=/opt/openssl -DOPENSSL_LOAD_CONF --openssldir=/opt/openssl
安装后$openssl version
显示如下,
ss@ss:~$ openssl version
OpenSSL 1.1.1c 28 May 2019
之后,我改变openssl.conf
如下,
openssl_conf = openssl_def
[openssl_def]
engines = engine_section
[engine_section]
rsa-engine-new = rsa_section
[rsa_section]
engine_id = rsa-engine-new
进行这些更改后,openssl engine
命令显示以下内容,
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 邮件列表中找到了解决方案。
发生的事情是,我将新配置放在openssl.cnf
文件的开头。因此,我有主要的 openssl 配置的残余。
然后我将以下部分移到openssl.cnf
文件末尾
[openssl_def]
engines = engine_section
[engine_section]
rsa-engine-new = rsa_section
[rsa_section]
engine_id = rsa-engine-new
dynamic_path = (PATH_TO_OPENSSL)/lib/engines-1.1/rsa-engine-new.so
并且引擎加载没有任何错误,
$openssl engine
(rdrand) Intel RDRAND engine
(dynamic) Dynamic engine loading support
(rsa-engine-new) engine for testing 1
推荐阅读
- r - 创建 R 函数问题
- outlook - 如何使用 appendOnSendAsync?
- amazon-web-services - 创建 IAM 用户以授予在 AWS EC2 中执行某些任务的权限
- image - 我的图像在它应该翻转时没有翻转(处理)
- java - Spring Boot Weblogic 部署
- php - 它不会停止去 else 部分,if 语句的问题
- java - 导入 Keras 模型时出现 ClassCastException
- hibernate - 当@Autowiring 时,Dao 和 JpaRepositories 抛出 NullPointerException
- javascript - 如何在不同的视口大小下按百分比减小绝对字体大小?
- javascript - 如何在香草 JS 中找到滚动的锚点?