Asterisk
  1. Asterisk
  2. ASTERISK-24436

Missing header in res/res_srtp.c when compiling against libsrtp-1.5.0

    Details

      Description

      Compilation of 11.13.0 against libsrtp 1.5.0 fails with the following error:

      gcc -o res_srtp.o -c res_srtp.c -MD -MT res_srtp.o -MF .res_srtp.o.d -MP -pthread -I/home/mockbuild/rpmbuild/BUILD/asterisk-11.13.0/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror-implicit-function-declaration -I/usr/include/libxml2 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -DAST_MODULE=\"res_srtp\" -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror-implicit-function-declaration
      res_srtp.c: In function 'ast_srtp_get_random':
      res_srtp.c:307: error: implicit declaration of function 'crypto_get_random'
      make[1]: *** [res_srtp.o] Error 1

      This seems to be caused by a missing header. The following pseudo patch fixes the problem for me:

      ASTERISK_FILE_VERSION(_FILE_, "$Revision: 413587 $")

      #include <srtp/srtp.h>
      +#include <srtp/crypto_kernel.h>

      #include "asterisk/lock.h"

        Issue Links

          Activity

          Hide
          Alexander Traud added a comment -

          Although the intro of libSRTP still suggests to use crypto_get_random, it was moved to a private header as of commit 4494760. Furthermore according to several commit messages (1, 2), the random-number generator (RNG) of the libSRTP 1.5.x branch might not be maintained anymore either. Because Asterisk uses OpenSSL anyway, the attached patch does not change the inclusion for a private header file but instead goes for OpenSSL. PJSIP took the same approach. Please, consider this patch for inclusion.

          Show
          Alexander Traud added a comment - Although the intro of libSRTP still suggests to use crypto_get_random , it was moved to a private header as of commit 4494760 . Furthermore according to several commit messages ( 1 , 2 ), the random-number generator (RNG) of the libSRTP 1.5.x branch might not be maintained anymore either. Because Asterisk uses OpenSSL anyway, the attached patch does not change the inclusion for a private header file but instead goes for OpenSSL. PJSIP took the same approach . Please, consider this patch for inclusion.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development