ldd does not show deb on -lcrypto
This problem was reported by Alexander Traud...
libsrtp.so has missing references to the OpenSSL AES-GCM symbols. This is because -lcrypto is not referenced by the library. The attached patch adds the reference to those symbols in that library.
Step to reproduce
- Ubuntu 14.04 LTS (32bit and 64bit tested, does not matter)
- sudo apt-get update
- sudo apt-get install git build-essential libssl-dev libncurses-dev libnewt-dev libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev libjansson-dev (these are my packages, because I compile Asterisk in the next step)
- git clone https://github.com/cisco/libsrtp.git
- cd ./libsrtp*
- ./configure --prefix=/usr --enable-openssl
- make libsrtp.so
- sudo make install
- ldd /usr/lib/libsrtp.so
Expected behavior ldd should show a dependency on -lcrypto
Actual behavior ldd does not show that at all
Regression If I create a small app which calls srtp_init, linking fails because the EVP_* symbols (AES-GCM) are not referenced. Furthermore, the configure script of Asterisk (and the one of PJSIP with --enabled-shared --with-external-srtp) are not able to detect libSRTP because they try to load srtp_init as well. With the above patch, my own app, Asterisk and PJSIP are happy.
Notes Solution is based on (see parameter library_list): http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html.
I do not know how to report issues within the libSRTP project and/or GitHub. If there is another formal process, please, point me to that. Because you added both the AES-GCM and the libsrtp.so code to the main branch, I contacted just you.
libsrtpSharedLibraryWithDep.patch
--- Makefile.in (revision 29b152e2126283d8084f786f78dad99d6e7c4468) +++ Makefile.in (working copy) @@ -117,8 +117,8 @@ $(RANLIB) libsrtp.a
libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi)
- $(CC) -shared -Wl,-soname,libsrtp.so $(LDFLAGS) \
-
-o libsrtp.so $^ - $(CC) -shared -Wl,-soname,libsrtp.so \
-
-o libsrtp.so $^ $(LDFLAGS)libcryptomath.a contains general-purpose routines that are used to
generate tables and verify cryptoalgorithm implementations - this
Resovled by 2b48665ac51be045e3fe87fbe35d38a3e93e8787