libsrtp icon indicating copy to clipboard operation
libsrtp copied to clipboard

ldd does not show deb on -lcrypto

Open jfigus opened this issue 12 years ago • 1 comments

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

  1. Ubuntu 14.04 LTS (32bit and 64bit tested, does not matter)
  2. sudo apt-get update
  3. 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)
  4. git clone https://github.com/cisco/libsrtp.git
  5. cd ./libsrtp*
  6. ./configure --prefix=/usr --enable-openssl
  7. make libsrtp.so
  8. sudo make install
  9. 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

jfigus avatar Jul 24 '14 18:07 jfigus

Resovled by 2b48665ac51be045e3fe87fbe35d38a3e93e8787

jfigus avatar Jul 24 '14 19:07 jfigus