Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C Openssl安装从另一个Openssl安装调用函数_C_Ssl - Fatal编程技术网

C Openssl安装从另一个Openssl安装调用函数

C Openssl安装从另一个Openssl安装调用函数,c,ssl,C,Ssl,这里的情况很奇怪 在Centos5上,我们有一个应用程序,它使用两个不同的特定版本的openssl(具体为1.0.1h和0.9.8u)向服务器发出请求。我们自己构建这两个版本,并将它们安装到非标准位置(例如/opt/foo/first-openssl和/opt/foo/other-openssl) config/build/install命令如下所示: $ ./openssl-1.0.1h/Configure --prefix=/opt/foo/first-openssl --with-krb5

这里的情况很奇怪

在Centos5上,我们有一个应用程序,它使用两个不同的特定版本的openssl(具体为1.0.1h和0.9.8u)向服务器发出请求。我们自己构建这两个版本,并将它们安装到非标准位置(例如/opt/foo/first-openssl和/opt/foo/other-openssl)

config/build/install命令如下所示:

$ ./openssl-1.0.1h/Configure --prefix=/opt/foo/first-openssl --with-krb5-flavor=MIT --with-krb5-dir=/opt/foo/krb5 shared zlib enable-rc5 enable-camellia enable-capieng enable-cms enable-mdc2 enable-idea enable-experimental enable-seed no-asm linux-generic64 -m64 -Wl,-rpath=/opt/foo/zlib/lib -Wl,-rpath=/opt/foo/krb5/lib -Wl,-rpath=/opt/foo/first-openssl/lib
$ make depend && make
$ make install

$ ./openssl-0.9.8u/Configure --prefix=/opt/foo/other-openssl --with-krb5-flavor=MIT --with-krb5-dir=/opt/foo/krb5 shared zlib enable-rc5 enable-camellia enable-capieng enable-cms enable-mdc2 enable-idea enable-experimental enable-seed no-asm linux-generic64 -m64 -Wl,-rpath=/opt/foo/zlib/lib -Wl,-rpath=/opt/foo/krb5/lib -Wl,-rpath=/opt/foo/other-openssl/lib
$ make depend && make
$ make install
但是,稍后我遇到了一个segfault,因为该应用程序调用了另一个openssl函数,该函数又调用了第一个openssl编译库中的crpyto函数。来自gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2aaab6dfb940 (LWP 15836)]
0x00002aaab1905bd4 in engine_unlocked_finish () from /opt/foo/first-openssl/lib/libcrypto.so.1.0.0
(gdb) bt
#0  0x00002aaab1905bd4 in engine_unlocked_finish () from /opt/foo/first-openssl/lib/libcrypto.so.1.0.0
#1  0x00002aaab1905cc1 in ENGINE_finish () from /opt/foo/first-openssl/lib/libcrypto.so.1.0.0
#2  0x00002aaab1919895 in EVP_DigestInit_ex () from /opt/foo/first-openssl/lib/libcrypto.so.1.0.0
#3  0x00002aaab701f90b in ssl3_connect () from /opt/foo/other-openssl/lib/libssl.so
#[snip]
但在/opt/foo/other openssl/lib中,所有内容看起来都链接正确

# ldd /opt/foo/other-openssl/lib/libssl.so
    linux-vdso.so.1 =>  (0x00007fffd11fd000)
    libcrypto.so.0.9.8 => /opt/foo/other-openssl/lib/libcrypto.so.0.9.8 (0x00002ab91fbd3000)
    libgssapi_krb5.so.2 => /opt/foo/lib/libgssapi_krb5.so.2 (0x00002ab91ff7f000)
    libkrb5.so.3 => /opt/foo/lib/libkrb5.so.3 (0x00002ab9201d5000)
    libcom_err.so.3 => /opt/foo/lib/libcom_err.so.3 (0x00002ab9204c0000)
    libk5crypto.so.3 => /opt/foo/lib/libk5crypto.so.3 (0x00002ab9206c4000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00002ab920915000)
    libz.so.1 => /opt/foo/lib/libz.so.1 (0x00002ab920b19000)
    libc.so.6 => /lib64/libc.so.6 (0x00002ab920d35000)
    libkrb5support.so.0 => /opt/foo/lib/libkrb5support.so.0 (0x00002ab92108e000)
    libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002ab92129a000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00002ab92149d000)
    /lib64/ld-linux-x86-64.so.2 (0x00000036b6a00000)
我确实看到了很多:

gcc: -rpath: linker input file unused because linking not done
gcc: /opt/foo/lib: linker input file unused because linking not done
gcc: -rpath: linker input file unused because linking not done
gcc: /opt/foo/other-openssl/lib: linker input file unused because linking not done
在为“其他openssl”运行命令时,我没有看到“第一个openssl”

我是不是在做一些愚蠢的事情来构建这些库?我们不做任何定制/修补,我也不明白为什么“其他openssl”库调用“第一个openssl”库