From 78a92f35ea2593b35b1aa1312aeab4999a0811cf Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 23 Jan 2008 20:17:42 +0000 Subject: Ticket #61: imported libsrtp into third_party directory (backported from srtp branch) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1730 74dad513-b988-da41-8d7b-12977e46ad98 --- third_party/build/srtp/Makefile | 87 +++++++ third_party/build/srtp/libsrtp.dsp | 346 +++++++++++++++++++++++++++ third_party/build/srtp/libsrtp.vcproj | 423 ++++++++++++++++++++++++++++++++++ third_party/build/srtp/srtp_config.h | 197 ++++++++++++++++ 4 files changed, 1053 insertions(+) create mode 100644 third_party/build/srtp/Makefile create mode 100644 third_party/build/srtp/libsrtp.dsp create mode 100644 third_party/build/srtp/libsrtp.vcproj create mode 100644 third_party/build/srtp/srtp_config.h (limited to 'third_party/build/srtp') diff --git a/third_party/build/srtp/Makefile b/third_party/build/srtp/Makefile new file mode 100644 index 00000000..7b4d1b41 --- /dev/null +++ b/third_party/build/srtp/Makefile @@ -0,0 +1,87 @@ +include ../../../build.mak +include ../../../build/common.mak + +export LIBDIR := ../../lib + +RULES_MAK := $(PJDIR)/build/rules.mak + +export SRTP_LIB := ../../lib/libsrtp-$(TARGET_NAME)$(LIBEXT) + +############################################################################### +# Gather all flags. +# +export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ + $(CFLAGS) $(CC_INC). $(CC_INC)../../srtp/crypto/include \ + $(CC_INC)../../srtp/include \ + $(CC_INC)../../../pjlib/include +export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ + $(HOST_CXXFLAGS) $(CXXFLAGS) +export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ + $(LDFLAGS) + +# libcrypt.a (the crypto engine) +ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o \ + crypto/cipher/aes.o crypto/cipher/aes_icm.o \ + crypto/cipher/aes_cbc.o + +hashes = crypto/hash/null_auth.o crypto/hash/sha1.o \ + crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o + +replay = crypto/replay/rdb.o crypto/replay/rdbx.o \ + crypto/replay/ut_sim.o + +math = crypto/math/datatypes.o crypto/math/stat.o + +ust = crypto/ust/ust.o + +rng = crypto/rng/rand_source.o crypto/rng/prng.o crypto/rng/ctr_prng.o + +err = pjlib/srtp_err.o + +kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \ + crypto/kernel/key.o $(rng) $(err) # $(ust) + +srtpobj = srtp/srtp.o + +cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) + +export SRTP_SRCDIR = ../../srtp +export SRTP_OBJS = $(cryptobj) $(srtpobj) +export SRTP_CFLAGS = -DHAVE_CONFIG_H $(_CFLAGS) + + +export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT +############################################################################### +# Main entry +# +# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. +# +TARGETS := libsrtp + +all: $(TARGETS) + +doc: + cd .. && doxygen docs/doxygen.cfg + +dep: depend +distclean: realclean + +.PHONY: dep depend libsrtp clean realclean distclean + +libsrtp: + $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(SRTP_LIB) + +clean print_lib: + $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ + +realclean: + $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR)) + + $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ + +depend: + $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ + echo '$(SRTP_LIB): .libsrtp-$(TARGET_NAME).depend' >> .libsrtp-$(TARGET_NAME).depend; \ + + + diff --git a/third_party/build/srtp/libsrtp.dsp b/third_party/build/srtp/libsrtp.dsp new file mode 100644 index 00000000..5b2f9483 --- /dev/null +++ b/third_party/build/srtp/libsrtp.dsp @@ -0,0 +1,346 @@ +# Microsoft Developer Studio Project File - Name="libsrtp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libsrtp - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsrtp.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsrtp.mak" CFG="libsrtp - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsrtp - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libsrtp - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsrtp - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\libsrtp-i386-win32-vc6-release" +# PROP BASE Intermediate_Dir "output\libsrtp-i386-win32-vc6-release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\libsrtp-i386-win32-vc6-release" +# PROP Intermediate_Dir "output\libsrtp-i386-win32-vc6-release" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /I "../../../pjlib/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\lib\libsrtp-i386-vc6-release.lib" + +!ELSEIF "$(CFG)" == "libsrtp - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\libsrtp-i386-win32-vc6-debug" +# PROP BASE Intermediate_Dir "output\libsrtp-i386-win32-vc6-debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\libsrtp-i386-win32-vc6-debug" +# PROP Intermediate_Dir "output\libsrtp-i386-win32-vc6-debug" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /I "../../../pjlib/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\lib\libsrtp-i386-vc6-debug.lib" + +!ENDIF + +# Begin Target + +# Name "libsrtp - Win32 Release" +# Name "libsrtp - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\srtp\srtp\srtp.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\pjlib\srtp_err.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\srtp\include\rtp.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\include\srtp.h +# End Source File +# Begin Source File + +SOURCE=.\srtp_config.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\include\ut_sim.h +# End Source File +# End Group +# Begin Group "crypto" + +# PROP Default_Filter "" +# Begin Group "ae_xfm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\ae_xfm\xfm.c +# End Source File +# End Group +# Begin Group "cipher" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\cipher\aes.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\cipher\aes_cbc.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\cipher\aes_icm.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\cipher\cipher.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\cipher\null_cipher.c +# End Source File +# End Group +# Begin Group "hash" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\hash\auth.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\hash\hmac.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\hash\null_auth.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\hash\sha1.c +# End Source File +# End Group +# Begin Group "include" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\aes.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\aes_cbc.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\aes_icm.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\alloc.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\auth.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\cipher.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\crypto.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\crypto_kernel.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\crypto_math.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\crypto_types.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\cryptoalg.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\datatypes.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\err.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\gf2_8.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\hmac.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\integers.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\kernel_compat.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\key.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\null_auth.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\null_cipher.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\prng.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\rand_source.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\rdb.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\rdbx.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\sha1.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\stat.h +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\include\xfm.h +# End Source File +# End Group +# Begin Group "kernel" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\kernel\alloc.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\kernel\crypto_kernel.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\kernel\key.c +# End Source File +# End Group +# Begin Group "math" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\math\datatypes.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\math\gf2_8.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\math\stat.c +# End Source File +# End Group +# Begin Group "replay" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\replay\rdb.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\replay\rdbx.c +# End Source File +# End Group +# Begin Group "rng" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\srtp\crypto\rng\ctr_prng.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\rng\prng.c +# End Source File +# Begin Source File + +SOURCE=..\..\srtp\crypto\rng\rand_source.c +# End Source File +# End Group +# End Group +# End Target +# End Project diff --git a/third_party/build/srtp/libsrtp.vcproj b/third_party/build/srtp/libsrtp.vcproj new file mode 100644 index 00000000..5ca91397 --- /dev/null +++ b/third_party/build/srtp/libsrtp.vcproj @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/build/srtp/srtp_config.h b/third_party/build/srtp/srtp_config.h new file mode 100644 index 00000000..b68b188d --- /dev/null +++ b/third_party/build/srtp/srtp_config.h @@ -0,0 +1,197 @@ +/* $Id$ */ +/* + * Copyright (C) 2003-2007 Benny Prijono + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __SRTP_CONFIG_H__ +#define __SRTP_CONFIG_H__ + +#include + +/* We'll just define CISC if it's x86 family */ +#if (defined(PJ_M_I386) && PJ_M_I386!=0) || \ + (defined(PJ_M_X86_64) && PJ_M_X86_64!=0) || \ + (defined(PJ_M_IA64) && PJ_M_IA64!=0) +# define CPU_CISC 1 +# define HAVE_X86 1 /* use X86 inlined assembly code */ +#else +# define CPU_RISC 1 +#endif + +/* Define to compile in dynamic debugging system. */ +#define ENABLE_DEBUGGING PJ_DEBUG + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H!=0 +# define HAVE_ARPA_INET_H 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the `inet_aton' function. */ +#if defined(PJ_SOCK_HAS_INET_PTON) && PJ_SOCK_HAS_INET_PTON +# define HAVE_INET_ATON 1 +#endif + + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H!=0 +# define HAVE_NETINET_IN_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H!=0 +# define HAVE_STDLIB_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H!=0 +# define HAVE_STRING_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H!=0 +# define HAVE_SYS_SOCKET_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H!=0 +# define HAVE_SYS_TYPES_H 1 +#endif + +/* Define to 1 if you have the header file. */ +/* Define to 1 if you have the `usleep' function. */ +#if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0 +# define HAVE_UNISTD_H 1 +# define HAVE_USLEEP 1 +#endif + + +/* Define to 1 if you have the header file. */ +#if defined(PJ_WIN32) && PJ_WIN32!=0 +# define HAVE_WINDOWS_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0 +# define HAVE_WINSOCK2_H 1 +#endif + +#define HAVE_INT16_T 1 +#define HAVE_INT32_T 1 +#define HAVE_INT8_T 1 +#define HAVE_UINT8_T 1 +#define HAVE_UINT16_T 1 +#define HAVE_UINT32_T 1 +#define HAVE_UINT64_T 1 + +/* Define to 1 if you have the header file. */ +#if defined(PJ_HAS_STDINT_H) && PJ_HAS_STDINT_H!=0 +# define HAVE_STDINT_H 1 +#else + typedef pj_uint8_t uint8_t; + typedef pj_uint16_t uint16_t; + typedef pj_uint32_t uint32_t; + typedef pj_uint64_t uint64_t; + typedef pj_int8_t int8_t; + typedef pj_int16_t int16_t; + typedef pj_int32_t int32_t; + typedef pj_int64_t int64_t; +#endif + +#define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long)) +#define SIZEOF_UNSIGNED_LONG_LONG 8 + + +#if (_MSC_VER >= 1400) // VC8+ +# ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +# endif +# ifndef _CRT_NONSTDC_NO_DEPRECATE +# define _CRT_NONSTDC_NO_DEPRECATE +# endif +#endif // VC8+ + +#ifdef _MSC_VER +# ifndef __cplusplus +# define inline _inline +# endif + +# pragma warning(disable:4311) +# pragma warning(disable:4761) // integral mismatch +# pragma warning(disable:4018) // signed/unsigned mismatch +# pragma warning(disable:4244) // conversion from int64 to int +#endif + + +/* Path to random device */ +/* #define DEV_URANDOM "/dev/urandom" */ + +/* We have overridden libsrtp error mechanism, so these are not used. */ +/* #undef ERR_REPORTING_FILE */ +/* #undef ERR_REPORTING_STDOUT */ +/* #undef USE_ERR_REPORTING_FILE */ +/* #undef USE_SYSLOG */ +/* #undef HAVE_SYSLOG_H */ + + +/* Define this to use ISMAcryp code. */ +/* #undef GENERIC_AESICM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `socket' function. */ +/* #undef HAVE_SOCKET */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_TYPES_H */ + + +/* Define to 1 if you have the header file. */ +//#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_INT_TYPES_H */ + +/* Define to use GDOI. */ +/* #undef SRTP_GDOI */ + +/* Define to compile for kernel contexts. */ +/* #undef SRTP_KERNEL */ + +/* Define to compile for Linux kernel context. */ +/* #undef SRTP_KERNEL_LINUX */ + +/* Define to 1 if you have the ANSI C header files. */ +//#define STDC_HEADERS 1 + +/* Endianness would have been set by pjlib. */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + + +#endif /* __SRTP_CONFIG_H__ */ + -- cgit v1.2.3