From d15cf87f82e9330a48490b75b18f80eb90d8aef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20B=C3=BChler?= Date: Fri, 7 Jun 2024 22:30:27 +0200 Subject: [PATCH] Update target to version 3 This changes the library name from libsrtp2 to libsrtp3. Since the API has changed and broken ABI compatibility with previous version it is import reflect this in the library name. This will also affect the public include path and import names for the various build systems. --- CMakeLists.txt | 62 ++++++------ Makefile.in | 76 +++++++-------- configure | 138 +++------------------------ configure.ac | 4 +- crypto/Makefile.in | 2 +- crypto/test/meson.build | 12 +-- doc/meson.build | 2 +- fuzzer/Makefile.in | 2 +- fuzzer/meson.build | 4 +- include/{srtp2 => srtp3}/meson.build | 0 libsrtp2.pc.in => libsrtp3.pc.in | 2 +- meson.build | 38 ++++---- meson_options.txt | 2 +- test/meson.build | 12 +-- 14 files changed, 122 insertions(+), 234 deletions(-) rename include/{srtp2 => srtp3}/meson.build (100%) rename libsrtp2.pc.in => libsrtp3.pc.in (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdf98c26c..ebb2c9750 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.21) -project(libsrtp2 VERSION 3.0.0 LANGUAGES C) +project(libsrtp3 VERSION 3.0.0 LANGUAGES C) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -269,7 +269,7 @@ source_group("src\\Math" FILES ${MATH_SOURCES_C}) source_group("src\\Replay" FILES ${REPLAY_SOURCES_C}) source_group("include" FILES ${SOURCES_H}) -add_library(srtp2 +add_library(srtp3 ${SOURCES_C} ${CIPHERS_SOURCES_C} ${HASHES_SOURCES_C} @@ -278,12 +278,12 @@ add_library(srtp2 ${REPLAY_SOURCES_C} ${SOURCES_H} ) -add_library(libSRTP::srtp2 ALIAS srtp2) +add_library(libSRTP::srtp3 ALIAS srtp3) if (${ENABLE_WARNINGS}) target_set_warnings( TARGET - "srtp2" + "srtp3" ENABLE ${ENABLE_WARNINGS} AS_ERRORS @@ -293,45 +293,45 @@ endif() if(${ENABLE_LTO}) target_enable_lto( TARGET - "srtp2" + "srtp3" ENABLE ON) endif() -set_target_properties(srtp2 PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(srtp3 PROPERTIES VERSION 1) -target_include_directories(srtp2 PUBLIC +target_include_directories(srtp3 PUBLIC $ $ $ ) if(ENABLE_OPENSSL) - target_include_directories(srtp2 PRIVATE ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(srtp2 OpenSSL::Crypto) + target_include_directories(srtp3 PRIVATE ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(srtp3 OpenSSL::Crypto) elseif(ENABLE_WOLFSSL) - target_include_directories(srtp2 PRIVATE ${WOLFSSL_INCLUDE_DIR}) - target_link_libraries(srtp2 ${WOLFSSL_LIBRARY}) + target_include_directories(srtp3 PRIVATE ${WOLFSSL_INCLUDE_DIR}) + target_link_libraries(srtp3 ${WOLFSSL_LIBRARY}) elseif(ENABLE_MBEDTLS) - target_include_directories(srtp2 PRIVATE ${MBEDTLS_INCLUDE_DIRS}) - target_link_libraries(srtp2 ${MBEDTLS_LIBRARIES}) + target_include_directories(srtp3 PRIVATE ${MBEDTLS_INCLUDE_DIRS}) + target_link_libraries(srtp3 ${MBEDTLS_LIBRARIES}) elseif(ENABLE_NSS) - target_include_directories(srtp2 PRIVATE ${NSS_INCLUDE_DIRS}) - target_link_libraries(srtp2 ${NSS_LIBRARIES}) + target_include_directories(srtp3 PRIVATE ${NSS_INCLUDE_DIRS}) + target_link_libraries(srtp3 ${NSS_LIBRARIES}) endif() if(WIN32) - target_link_libraries(srtp2 ws2_32) - target_compile_definitions(srtp2 PUBLIC _CRT_SECURE_NO_WARNINGS) + target_link_libraries(srtp3 ws2_32) + target_compile_definitions(srtp3 PUBLIC _CRT_SECURE_NO_WARNINGS) endif() -install(TARGETS srtp2 DESTINATION lib +install(TARGETS srtp3 DESTINATION lib EXPORT libSRTPTargets ) install(FILES include/srtp.h crypto/include/auth.h crypto/include/cipher.h crypto/include/crypto_types.h - DESTINATION include/srtp2) + DESTINATION include/srtp3) if(LIBSRTP_TEST_APPS) enable_testing() @@ -339,14 +339,14 @@ if(LIBSRTP_TEST_APPS) find_package(PCAP) if (PCAP_FOUND) add_executable(rtp_decoder test/rtp_decoder.c test/getopt_s.c test/util.c) - target_link_libraries(rtp_decoder srtp2 ${PCAP_LIBRARY}) + target_link_libraries(rtp_decoder srtp3 ${PCAP_LIBRARY}) endif() if(NOT (BUILD_SHARED_LIBS AND WIN32)) if(NOT USE_EXTERNAL_CRYPTO) add_executable(aes_calc crypto/test/aes_calc.c test/getopt_s.c test/util.c) target_include_directories(aes_calc PRIVATE test) - target_link_libraries(aes_calc srtp2) + target_link_libraries(aes_calc srtp3) target_set_warnings( TARGET aes_calc @@ -370,7 +370,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(sha1_driver PRIVATE test) - target_link_libraries(sha1_driver srtp2) + target_link_libraries(sha1_driver srtp3) add_test(sha1_driver sha1_driver -v) endif() @@ -383,7 +383,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(datatypes_driver PRIVATE test) - target_link_libraries(datatypes_driver srtp2) + target_link_libraries(datatypes_driver srtp3) add_test(datatypes_driver datatypes_driver -v) add_executable(cipher_driver crypto/test/cipher_driver.c test/getopt_s.c) @@ -395,7 +395,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(cipher_driver PRIVATE test) - target_link_libraries(cipher_driver srtp2) + target_link_libraries(cipher_driver srtp3) add_test(cipher_driver cipher_driver -v) add_executable(kernel_driver crypto/test/kernel_driver.c test/getopt_s.c) @@ -407,7 +407,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(kernel_driver PRIVATE test) - target_link_libraries(kernel_driver srtp2) + target_link_libraries(kernel_driver srtp3) add_test(kernel_driver kernel_driver -v) add_executable(rdbx_driver test/rdbx_driver.c test/getopt_s.c test/ut_sim.c) @@ -419,7 +419,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(rdbx_driver PRIVATE test) - target_link_libraries(rdbx_driver srtp2) + target_link_libraries(rdbx_driver srtp3) add_test(rdbx_driver rdbx_driver -v) add_executable(replay_driver test/replay_driver.c test/ut_sim.c) @@ -431,7 +431,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(replay_driver PRIVATE test) - target_link_libraries(replay_driver srtp2) + target_link_libraries(replay_driver srtp3) add_test(replay_driver replay_driver -v) add_executable(roc_driver test/roc_driver.c test/ut_sim.c) @@ -443,7 +443,7 @@ if(LIBSRTP_TEST_APPS) AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) target_include_directories(roc_driver PRIVATE test) - target_link_libraries(roc_driver srtp2) + target_link_libraries(roc_driver srtp3) add_test(roc_driver roc_driver -v) endif() @@ -456,7 +456,7 @@ if(LIBSRTP_TEST_APPS) ${ENABLE_WARNINGS} AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) - target_link_libraries(srtp_driver srtp2) + target_link_libraries(srtp_driver srtp3) add_test(srtp_driver srtp_driver -v) if(NOT (BUILD_SHARED_LIBS AND WIN32)) @@ -477,7 +477,7 @@ if(LIBSRTP_TEST_APPS) elseif(ENABLE_NSS) target_include_directories(test_srtp PRIVATE ${NSS_INCLUDE_DIRS}) endif() - target_link_libraries(test_srtp srtp2) + target_link_libraries(test_srtp srtp3) add_test(test_srtp test_srtp) endif() @@ -491,7 +491,7 @@ if(LIBSRTP_TEST_APPS) ${ENABLE_WARNINGS} AS_ERRORS ${ENABLE_WARNINGS_AS_ERRORS}) - target_link_libraries(rtpw srtp2) + target_link_libraries(rtpw srtp3) add_test(NAME rtpw_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/rtpw_test.sh -w ${CMAKE_CURRENT_SOURCE_DIR}/test/words.txt WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) diff --git a/Makefile.in b/Makefile.in index 69922cf93..33bc66b03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,8 +8,8 @@ # runtest runs test applications # runtest-valgrind runs test applications with valgrind # test builds test applications -# libsrtp2.a static library implementing srtp -# libsrtp2.so shared library implementing srtp +# libsrtp3.a static library implementing srtp +# libsrtp3.so shared library implementing srtp # clean removes objects, libs, and executables # distribution cleans and builds a .tgz # tags builds etags file from all .c and .h files @@ -43,7 +43,7 @@ endif all: test runtest: test - @echo "running libsrtp2 test applications..." + @echo "running libsrtp3 test applications..." $(FIND_LIBRARIES) crypto/test/cipher_driver$(EXE) -v >/dev/null $(FIND_LIBRARIES) crypto/test/kernel_driver$(EXE) -v >/dev/null $(FIND_LIBRARIES) test/test_srtp$(EXE) >/dev/null @@ -55,14 +55,14 @@ runtest: test ifeq (1, $(USE_EXTERNAL_CRYPTO)) cd test; $(CRYPTO_LIBDIR_FORWARD) $(abspath $(srcdir))/test/rtpw_test_gcm.sh -w $(abspath $(srcdir))/test/words.txt >/dev/null endif - @echo "libsrtp2 test applications passed." + @echo "libsrtp3 test applications passed." $(MAKE) -C crypto runtest runtest-valgrind: test - @echo "running libsrtp2 test applications... (valgrind)" + @echo "running libsrtp3 test applications... (valgrind)" valgrind --error-exitcode=1 --leak-check=full test/test_srtp$(EXE) -v >/dev/null valgrind --error-exitcode=1 --leak-check=full test/srtp_driver$(EXE) -v >/dev/null - @echo "libsrtp2 test applications passed. (valgrind)" + @echo "libsrtp3 test applications passed. (valgrind)" # makefile variables @@ -78,7 +78,7 @@ srtp-fuzzer: CXXFLAGS += -g LIBS = @LIBS@ LDFLAGS = -L. @LDFLAGS@ COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) -SRTPLIB = -lsrtp2 +SRTPLIB = -lsrtp3 PCAP_LIB = @PCAP_LIB@ AR = @AR@ @@ -103,7 +103,7 @@ libdir = @libdir@ bindir = @bindir@ pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libsrtp2.pc +pkgconfig_DATA = libsrtp3.pc SHAREDLIBVERSION = 1 ifneq (,$(or $(findstring linux,@host@), $(findstring gnu,@host@))) @@ -113,7 +113,7 @@ SHAREDLIBSUFFIXNOVER = so SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION) else ifneq (,$(or $(findstring cygwin,@host@), $(findstring mingw,@host@))) SHAREDLIB_DIR = $(bindir) -SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp2.dll.a +SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp3.dll.a SHAREDLIBVERSION = SHAREDLIBSUFFIXNOVER = dll SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER) @@ -154,26 +154,26 @@ kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \ cryptobj = $(ciphers) $(hashes) $(math) $(kernel) $(replay) -# libsrtp2.a (implements srtp processing) +# libsrtp3.a (implements srtp processing) srtpobj = srtp/srtp.o -libsrtp2.a: $(srtpobj) $(cryptobj) $(gdoi) - $(AR) cr libsrtp2.a $^ - $(RANLIB) libsrtp2.a +libsrtp3.a: $(srtpobj) $(cryptobj) $(gdoi) + $(AR) cr libsrtp3.a $^ + $(RANLIB) libsrtp3.a -libsrtp2.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi) +libsrtp3.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi) $(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \ $^ $(LDFLAGS) $(LIBS) if [ -n "$(SHAREDLIBVERSION)" ]; then \ - ln -sfn $@ libsrtp2.$(SHAREDLIBSUFFIXNOVER); \ + ln -sfn $@ libsrtp3.$(SHAREDLIBSUFFIXNOVER); \ fi -shared_library: libsrtp2.$(SHAREDLIBSUFFIX) +shared_library: libsrtp3.$(SHAREDLIBSUFFIX) -libsrtp2.so: $(srtpobj) $(cryptobj) - $(CC) -shared -Wl,-soname,libsrtp2.so \ - -o libsrtp2.so $^ $(LDFLAGS) +libsrtp3.so: $(srtpobj) $(cryptobj) + $(CC) -shared -Wl,-soname,libsrtp3.so \ + -o libsrtp3.so $^ $(LDFLAGS) # test applications ifneq (1, $(USE_EXTERNAL_CRYPTO)) @@ -193,7 +193,7 @@ ifeq (1, $(HAVE_PCAP)) testapp += test/rtp_decoder$(EXE) endif -$(testapp): libsrtp2.a +$(testapp): libsrtp3.a test/rtpw$(EXE): test/rtpw.c test/rtp.c test/util.c test/getopt_s.c \ crypto/math/datatypes.c @@ -264,47 +264,47 @@ tags: etags */*.[ch] */*/*.[ch] -# documentation - the target libsrtp2doc builds html documentation +# documentation - the target libsrtp3doc builds html documentation -libsrtp2doc: +libsrtp3doc: $(MAKE) -C doc # fuzzer -srtp-fuzzer: libsrtp2.a +srtp-fuzzer: libsrtp3.a $(MAKE) -C fuzzer .PHONY: clean superclean distclean install install: - $(INSTALL) -d $(DESTDIR)$(includedir)/srtp2 + $(INSTALL) -d $(DESTDIR)$(includedir)/srtp3 $(INSTALL) -d $(DESTDIR)$(libdir) - cp $(srcdir)/include/srtp.h $(DESTDIR)$(includedir)/srtp2 - cp $(srcdir)/crypto/include/cipher.h $(DESTDIR)$(includedir)/srtp2 - cp $(srcdir)/crypto/include/auth.h $(DESTDIR)$(includedir)/srtp2 - cp $(srcdir)/crypto/include/crypto_types.h $(DESTDIR)$(includedir)/srtp2 - if [ -f libsrtp2.a ]; then cp libsrtp2.a $(DESTDIR)$(libdir)/; fi - if [ -f libsrtp2.dll.a ]; then cp libsrtp2.dll.a $(DESTDIR)$(libdir)/; fi - if [ -f libsrtp2.$(SHAREDLIBSUFFIX) ]; then \ + cp $(srcdir)/include/srtp.h $(DESTDIR)$(includedir)/srtp3 + cp $(srcdir)/crypto/include/cipher.h $(DESTDIR)$(includedir)/srtp3 + cp $(srcdir)/crypto/include/auth.h $(DESTDIR)$(includedir)/srtp3 + cp $(srcdir)/crypto/include/crypto_types.h $(DESTDIR)$(includedir)/srtp3 + if [ -f libsrtp3.a ]; then cp libsrtp3.a $(DESTDIR)$(libdir)/; fi + if [ -f libsrtp3.dll.a ]; then cp libsrtp3.dll.a $(DESTDIR)$(libdir)/; fi + if [ -f libsrtp3.$(SHAREDLIBSUFFIX) ]; then \ $(INSTALL) -d $(DESTDIR)$(SHAREDLIB_DIR); \ - cp libsrtp2.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ - cp libsrtp2.$(SHAREDLIBSUFFIXNOVER) $(DESTDIR)$(SHAREDLIB_DIR)/; \ + cp libsrtp3.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ + cp libsrtp3.$(SHAREDLIBSUFFIXNOVER) $(DESTDIR)$(SHAREDLIB_DIR)/; \ if [ -n "$(SHAREDLIBVERSION)" ]; then \ - ln -sfn libsrtp2.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp2.$(SHAREDLIBSUFFIXNOVER); \ + ln -sfn libsrtp3.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp3.$(SHAREDLIBSUFFIXNOVER); \ fi; \ fi $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) cp $(top_builddir)/$(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/ uninstall: - rm -f $(DESTDIR)$(includedir)/srtp2/*.h - rm -f $(DESTDIR)$(libdir)/libsrtp2.* - -rmdir $(DESTDIR)$(includedir)/srtp2 + rm -f $(DESTDIR)$(includedir)/srtp3/*.h + rm -f $(DESTDIR)$(libdir)/libsrtp3.* + -rmdir $(DESTDIR)$(includedir)/srtp3 rm -f $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA) clean: rm -rf $(cryptobj) $(srtpobj) TAGS \ - libsrtp2.a libsrtp2.so libsrtp2.dll.a core *.core test/core + libsrtp3.a libsrtp3.so libsrtp3.dll.a core *.core test/core for a in * */* */*/*; do \ if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ done; diff --git a/configure b/configure index 91f8a7417..3d4e12874 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libsrtp2 3.0.0-pre. +# Generated by GNU Autoconf 2.69 for libsrtp3 3.0.0-pre. # # Report bugs to . # @@ -578,10 +578,10 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='libsrtp2' -PACKAGE_TARNAME='libsrtp2' +PACKAGE_NAME='libsrtp3' +PACKAGE_TARNAME='libsrtp3' PACKAGE_VERSION='3.0.0-pre' -PACKAGE_STRING='libsrtp2 3.0.0-pre' +PACKAGE_STRING='libsrtp3 3.0.0-pre' PACKAGE_BUGREPORT='https://github.com/cisco/libsrtp/issues' PACKAGE_URL='' @@ -1290,7 +1290,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libsrtp2 3.0.0-pre to adapt to many kinds of systems. +\`configure' configures libsrtp3 3.0.0-pre to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1339,7 +1339,7 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/libsrtp2] + --docdir=DIR documentation root [DATAROOTDIR/doc/libsrtp3] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1356,7 +1356,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libsrtp2 3.0.0-pre:";; + short | recursive ) echo "Configuration of libsrtp3 3.0.0-pre:";; esac cat <<\_ACEOF @@ -1471,7 +1471,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libsrtp2 configure 3.0.0-pre +libsrtp3 configure 3.0.0-pre generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2024,7 +2024,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libsrtp2 $as_me 3.0.0-pre, which was +It was created by libsrtp3 $as_me 3.0.0-pre, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4789,118 +4789,6 @@ done CFLAGS="$supported_cflags" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - for ac_header in unistd.h byteswap.h stdint.h sys/uio.h inttypes.h sys/types.h machine/types.h sys/int_types.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -6660,7 +6548,7 @@ fi ac_config_headers="$ac_config_headers crypto/include/config.h:config_in.h" -ac_config_files="$ac_config_files Makefile crypto/Makefile doc/Makefile fuzzer/Makefile libsrtp2.pc" +ac_config_files="$ac_config_files Makefile crypto/Makefile doc/Makefile fuzzer/Makefile libsrtp3.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7169,7 +7057,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libsrtp2 $as_me 3.0.0-pre, which was +This file was extended by libsrtp3 $as_me 3.0.0-pre, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7231,7 +7119,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libsrtp2 config.status 3.0.0-pre +libsrtp3 config.status 3.0.0-pre configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -7358,7 +7246,7 @@ do "crypto/Makefile") CONFIG_FILES="$CONFIG_FILES crypto/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "fuzzer/Makefile") CONFIG_FILES="$CONFIG_FILES fuzzer/Makefile" ;; - "libsrtp2.pc") CONFIG_FILES="$CONFIG_FILES libsrtp2.pc" ;; + "libsrtp3.pc") CONFIG_FILES="$CONFIG_FILES libsrtp3.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index 1f3024afa..54fd36bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([libsrtp2], [3.0.0-pre], [https://github.com/cisco/libsrtp/issues]) +AC_INIT([libsrtp3],[3.0.0-pre],[https://github.com/cisco/libsrtp/issues]) dnl Must come before AC_PROG_CC EMPTY_CFLAGS="no" @@ -425,7 +425,7 @@ AS_IF([test "x$EXTRA_CFLAGS" != "x"], AC_CONFIG_HEADER([crypto/include/config.h:config_in.h]) -AC_CONFIG_FILES([Makefile crypto/Makefile doc/Makefile fuzzer/Makefile libsrtp2.pc]) +AC_CONFIG_FILES([Makefile crypto/Makefile doc/Makefile fuzzer/Makefile libsrtp3.pc]) AC_OUTPUT # This is needed when building outside the source dir. diff --git a/crypto/Makefile.in b/crypto/Makefile.in index 8c2c4fabe..8eff89c5b 100644 --- a/crypto/Makefile.in +++ b/crypto/Makefile.in @@ -16,7 +16,7 @@ CFLAGS = @CFLAGS@ LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ -L. -L.. COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) -CRYPTOLIB = -lsrtp2 +CRYPTOLIB = -lsrtp3 CRYPTO_LIBDIR = @CRYPTO_LIBDIR@ RANLIB = @RANLIB@ diff --git a/crypto/test/meson.build b/crypto/test/meson.build index b49696210..3528e288a 100644 --- a/crypto/test/meson.build +++ b/crypto/test/meson.build @@ -14,18 +14,18 @@ endif foreach test_name : test_apps test_exe = executable(test_name, '@0@.c'.format(test_name), '../../test/getopt_s.c', '../../test/util.c', - include_directories: [config_incs, crypto_incs, srtp2_incs, test_incs], - dependencies: [srtp2_deps, syslibs], - link_with: libsrtp2_for_tests) + include_directories: [config_incs, crypto_incs, srtp3_incs, test_incs], + dependencies: [srtp3_deps, syslibs], + link_with: libsrtp3_for_tests) test(test_name, test_exe, args: ['-v']) endforeach if not use_openssl and not use_wolfssl and not use_nss and not use_mbedtls test_exe = executable('aes_calc', 'aes_calc.c', '../../test/getopt_s.c', '../../test/util.c', - include_directories: [config_incs, crypto_incs, srtp2_incs, test_incs], - dependencies: [srtp2_deps, syslibs], - link_with: libsrtp2_for_tests) + include_directories: [config_incs, crypto_incs, srtp3_incs, test_incs], + dependencies: [srtp3_deps, syslibs], + link_with: libsrtp3_for_tests) # data values used to test the aes_calc application for AES-128 k128 = '000102030405060708090a0b0c0d0e0f' diff --git a/doc/meson.build b/doc/meson.build index a693897e8..f1bcf18a4 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -19,4 +19,4 @@ doxygen_html_docs = custom_target('doc', command: [doxygen, doxyfile], output: ['html']) -alias_target('libsrtp2doc', doxygen_html_docs) +alias_target('libsrtp3doc', doxygen_html_docs) diff --git a/fuzzer/Makefile.in b/fuzzer/Makefile.in index cd107faa9..964f25f3d 100644 --- a/fuzzer/Makefile.in +++ b/fuzzer/Makefile.in @@ -15,7 +15,7 @@ CFLAGS = @CFLAGS@ -g LIBS = @LIBS@ COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) COMPILECXX = $(CXX) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CXXFLAGS) -CRYPTOLIB = -lsrtp2 +CRYPTOLIB = -lsrtp3 .PHONY: clean diff --git a/fuzzer/meson.build b/fuzzer/meson.build index 3b1def605..9f76bcd34 100644 --- a/fuzzer/meson.build +++ b/fuzzer/meson.build @@ -22,10 +22,10 @@ threads = dependency('threads') if libfuzzer.found() executable('srtp-fuzzer', 'fuzzer.c', 'testmem.c', 'mt19937.cpp', - include_directories: [config_incs, crypto_incs, srtp2_incs], + include_directories: [config_incs, crypto_incs, srtp3_incs], cpp_args: ['-fsanitize=fuzzer'], override_options : ['cpp_std=c++11'], dependencies: [libfuzzer, threads], - link_with: libsrtp2, + link_with: libsrtp3, install: false) endif diff --git a/include/srtp2/meson.build b/include/srtp3/meson.build similarity index 100% rename from include/srtp2/meson.build rename to include/srtp3/meson.build diff --git a/libsrtp2.pc.in b/libsrtp3.pc.in similarity index 90% rename from libsrtp2.pc.in rename to libsrtp3.pc.in index f2097a3a2..b54d9e577 100644 --- a/libsrtp2.pc.in +++ b/libsrtp3.pc.in @@ -7,6 +7,6 @@ Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ Description: Library for SRTP (Secure Realtime Transport Protocol) -Libs: -L${libdir} -lsrtp2 +Libs: -L${libdir} -lsrtp3 Libs.private: @LIBS@ Cflags: -I${includedir} diff --git a/meson.build b/meson.build index 8b11c25cf..d8372986e 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libsrtp2', 'c', version: '3.0.0', +project('libsrtp3', 'c', version: '3.0.0', meson_version: '>= 0.52.0', default_options: ['buildtype=debugoptimized']) @@ -7,7 +7,7 @@ soversion = 1 cc = meson.get_compiler('c') host_system = host_machine.system() -srtp2_deps = [] +srtp3_deps = [] syslibs = [] if host_system == 'windows' @@ -127,7 +127,7 @@ use_mbedtls = false crypto_library = get_option('crypto-library') if crypto_library == 'openssl' openssl_dep = dependency('openssl', version: '>= 1.1.0', required: true) - srtp2_deps += [openssl_dep] + srtp3_deps += [openssl_dep] cdata.set('GCM', true) cdata.set('OPENSSL', true) cdata.set('USE_EXTERNAL_CRYPTO', true) @@ -145,7 +145,7 @@ if crypto_library == 'openssl' endif elif crypto_library == 'wolfssl' wolfssl_dep = dependency('wolfssl', version: '>= 5.7.0', required: true) - srtp2_deps += [wolfssl_dep] + srtp3_deps += [wolfssl_dep] cdata.set('GCM', true) cdata.set('WOLFSSL', true) cdata.set('USE_EXTERNAL_CRYPTO', true) @@ -161,7 +161,7 @@ elif crypto_library == 'wolfssl' endif elif crypto_library == 'nss' nss_dep = dependency('nss', version: '>= 1.0.1', required: true) - srtp2_deps += [nss_dep] + srtp3_deps += [nss_dep] cdata.set('GCM', true) cdata.set('NSS', true) cdata.set('USE_EXTERNAL_CRYPTO', true) @@ -175,7 +175,7 @@ elif crypto_library == 'mbedtls' if not mbedtls_dep.found() mbedtls_dep = cc.find_library('mbedcrypto', has_headers: ['mbedtls/aes.h'], required: true) endif - srtp2_deps += [mbedtls_dep] + srtp3_deps += [mbedtls_dep] cdata.set('GCM', true) cdata.set('MBEDTLS', true) cdata.set('USE_EXTERNAL_CRYPTO', true) @@ -289,44 +289,44 @@ public_headers = files( 'crypto/include/cipher.h', 'crypto/include/crypto_types.h', ) -install_headers(public_headers, subdir : 'srtp2') +install_headers(public_headers, subdir : 'srtp3') config_incs = include_directories('.') crypto_incs = include_directories('crypto/include') -srtp2_incs = include_directories('include') +srtp3_incs = include_directories('include') test_incs = include_directories('test') default_library = get_option('default_library') -libsrtp2_static = static_library('srtp2', sources, ciphers_sources, hashes_sources, +libsrtp3_static = static_library('srtp3', sources, ciphers_sources, hashes_sources, kernel_sources, math_sources, replay_sources, - dependencies: [srtp2_deps, syslibs], - include_directories: [crypto_incs, srtp2_incs], + dependencies: [srtp3_deps, syslibs], + include_directories: [crypto_incs, srtp3_incs], install: default_library != 'shared') if default_library != 'static' - libsrtp2 = shared_library('srtp2', + libsrtp3 = shared_library('srtp3', soversion : soversion, vs_module_defs: 'srtp.def', - link_whole: libsrtp2_static, + link_whole: libsrtp3_static, install: true) else - libsrtp2 = libsrtp2_static + libsrtp3 = libsrtp3_static endif -subdir('include/srtp2') # copies public_headers into the builddir +subdir('include/srtp3') # copies public_headers into the builddir public_incs = include_directories('include') # sets public_incs -libsrtp2_dep = declare_dependency(link_with: libsrtp2, +libsrtp3_dep = declare_dependency(link_with: libsrtp3, include_directories: public_incs) if not get_option('tests').disabled() # Tests use non-public API, and when building on Windows the only symbols we # export are those in srtp.def, so link to the static library in that case. if host_system == 'windows' - libsrtp2_for_tests = libsrtp2_static + libsrtp3_for_tests = libsrtp3_static else - libsrtp2_for_tests = libsrtp2 + libsrtp3_for_tests = libsrtp3 endif subdir('crypto/test') subdir('test') @@ -341,7 +341,7 @@ if not get_option('doc').disabled() endif pkgconfig = import('pkgconfig') -pkgconfig.generate(libsrtp2, +pkgconfig.generate(libsrtp3, filebase: meson.project_name(), name: meson.project_name(), version: meson.project_version(), diff --git a/meson_options.txt b/meson_options.txt index 80e03b87a..2b90375c1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,7 +9,7 @@ option('crypto-library', type: 'combo', choices : ['none', 'openssl', 'wolfssl', option('crypto-library-kdf', type : 'feature', value : 'auto', description : 'Use the external crypto library for Key Derivation Function support') option('fuzzer', type : 'feature', value : 'disabled', - description : 'Build libsrtp2 fuzzer (requires build with clang)') + description : 'Build libsrtp fuzzer (requires build with clang)') option('tests', type : 'feature', value : 'auto', yield : true, description : 'Build test applications') option('pcap-tests', type : 'feature', value : 'auto', diff --git a/test/meson.build b/test/meson.build index 214576271..6f0511859 100644 --- a/test/meson.build +++ b/test/meson.build @@ -22,9 +22,9 @@ foreach t : test_apps test_exe = executable(test_name, '@0@.c'.format(test_name), 'getopt_s.c', test_extra_sources, - include_directories: [config_incs, crypto_incs, srtp2_incs, test_incs], - dependencies: [srtp2_deps, syslibs], - link_with: libsrtp2_for_tests) + include_directories: [config_incs, crypto_incs, srtp3_incs, test_incs], + dependencies: [srtp3_deps, syslibs], + link_with: libsrtp3_for_tests) if test_dict.get('define_test', true) test(test_name, test_exe, args: test_run_args) @@ -70,8 +70,8 @@ if pcap_dep.found() executable('rtp_decoder', 'rtp_decoder.c', 'getopt_s.c', 'rtp.c', 'util.c', 'getopt_s.c', '../crypto/math/datatypes.c', - include_directories: [config_incs, crypto_incs, srtp2_incs, test_incs], - dependencies: [srtp2_deps, pcap_dep, syslibs], - link_with: libsrtp2, + include_directories: [config_incs, crypto_incs, srtp3_incs, test_incs], + dependencies: [srtp3_deps, pcap_dep, syslibs], + link_with: libsrtp3, install: false) endif