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

时间:2014-06-17 19:38:07

标签: c ssl

奇怪的情况......

在Centos5上,我们有一个应用程序,它使用2个不同的特定版本的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

但是,我之后遇到了一个段错误,因为该应用程序调用了另一个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

在运行' other-openssl'我没有看到&first-openssl'

我是否因为构建这些库而做了些蠢事?我们不做任何定制/打补丁,而且我无法弄清楚为什么这个'其他 - openssl'图书馆正在呼唤“第一次开放”。库。

0 个答案:

没有答案