CentOS 8.1使用编译OpenSSL报错symbol EVP_KDF_* not defined in file libcrypto.so.1.1

在CentOS 8.1 系统上采用之前方式编译安装完OpenSSL后,发现SSH无法使用,提示openssl库有特性不支持:

[root@csbook1 ~]# ssh -v
ssh: relocation error: ssh: symbol EVP_KDF_ctrl version OPENSSL_1_1_1b not defined in file libcrypto.so.1.1 with link time reference

经过一番查找,是由于自编译的OpenSSL库没有EVP_KDF_*的相关特性导致:

可以看到,自已编译安装的OpenSSL的动态库文件没有EVP_KDF的相关symbol。

经过查寻,OpenSSL官方解释为:EVP_KDF特性为OpenSSL 3.0中添加,RHEL8 / CentOS 8系统中的特性为系统自行添加:

相关网页链接:EVP_KDF说明页,官方Github问题页。

知道原因后,故重启编译安装OpenSSL,强制使其使用自己的动态链接库并将其从系统动态库搜索路径中去除:

tar zxf openssl-1.1.1g.tar.gz -C /usr/local/src/
cd /usr/local/src/openssl-1.1.1g/
CFLAGS="-fPIC -O3" ./config --prefix=/usr/local/openssl shared threads zlib enable-md2 --release -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
make -j `cat /proc/cpuinfo | grep processor | wc -l` && make install

添加了-Wl,–enable-new-dtags,-rpath,’$(LIBRPATH)’选项,其会自动转到LDFLAGS中。

安装完成后,将原先添加的动态库搜索路径去除;然后查看自编译的openssl动态库连接关系和系统自带ssh:

 

《CentOS 8.1使用编译OpenSSL报错symbol EVP_KDF_* not defined in file libcrypto.so.1.1》有11条评论

  1. 我按照你的命令处理之后,我输入命令 ssh -v 还是报错:ssh: relocation error: ssh: symbol EVP_KDF_ctrl version OPENSSL_1_1_1b not defined in file libcrypto.so.1.1 with link time reference

    回复
  2. 你好博主 我按照你的操作 也删除了/etc/ld.so.conf中openssl路径 还是报EVP_KDF_ctrl not define in libcrypto.so.1.1的错误,请问有什么解决办法么?

    回复
    • 你好,请使用 “ldconfig -p | grep ssl” 命令查看当前系统搜索的动态库路径中是否还有自编译 openssl 的路径。

      回复
  3. 你好,我删除了/etc/ld.so.conf中openssl路径,没有出现EVP_KDF_ctrl 报错了,但是查看openssl 又降低会系统自带的版本了,没有实现升级到最新版openssl的目的。
    [root@localhost ~]# openssl version
    OpenSSL 1.1.1h 22 Sep 2020 (Library: OpenSSL 1.1.1c FIPS 28 May 2019)
    [root@localhost ~]# ssh -V
    OpenSSH_8.4p1, OpenSSL 1.1.1c FIPS 28 May 2019

    回复
    • 是的,从 /etc/ld.so.conf 中删除自编译库路径后,系统就会调用自带的库。
      想要执行新的openssl命令,而不调用新库,将编译安装的bin路径添加至系统 $PATH 路径中即可。

      回复
  4. 你好
    从 /etc/ld.so.conf 中删除自编译库路径之前
    [root@localhost openssh-8.4p1]# ssh -V
    OpenSSH_8.4p1, OpenSSL 1.1.1i 8 Dec 2020
    [root@localhost openssh-8.4p1]# openssl version
    OpenSSL 1.1.1i 8 Dec 2020
    yum 出现EVP_KDF_ctrl 报错

    从 /etc/ld.so.conf 中删除自编译库路径之后
    [root@localhost openssh-8.4p1]# openssl version
    OpenSSL 1.1.1i 8 Dec 2020
    [root@localhost openssh-8.4p1]# ssh -V
    OpenSSH_8.4p1, OpenSSL 1.1.1g FIPS 21 Apr 2020
    yum 是ok的

    这个要怎么解决
    我想把ssh用的ssl升级成最新版i,但是yum就不能用了
    没看懂将编译安装的bin路径添加至系统 $PATH
    我加了没效果的

    回复
    • 你好,RHEL/CentOS 8系统自带的SSH等使用自带的openssl即可(原因如文中所讲),使用yum从官方更新;如果是其它自编译的程序可使用自编译的openssl,在编译过程中指定要链接的库路径即可,而编译版的openssl库路径不要加入到系统搜索的库路径中(/etc/ld.so.conf),以免系统自身的ssh等程序调用到编译版的openssl出现未定义错误。

      回复
        • 你好,周末休息,没注意到及时回复;我看了下漏洞说明:https://www.openssl.org/news/vulnerabilities-1.1.1.html#CVE-2020-1971 。受影响的是验证证书吊销列表CRL时可能出现的问题(打开一个带有其颁发机构的证书,在“证书路径”中打开其直接上级证书,在其“详细信息”中可以看到扩展信息的“CRL分发点”地址),如果你们是使用购买的正规证书或完全自签发的独立证书的话,不会受此影响;且OpenSSL在12/8号在1.1.1h的基础上进行的修复更新,估计不久yum源也会进行更新的。

          回复

回复 牧青云 取消回复

error: Content is protected !!