diff options
Diffstat (limited to 'thirdparties/mac/include/srtp')
38 files changed, 414 insertions, 36 deletions
diff --git a/thirdparties/mac/include/srtp/aes.h b/thirdparties/mac/include/srtp/aes.h index 2881337..d88ce40 100644..100755 --- a/thirdparties/mac/include/srtp/aes.h +++ b/thirdparties/mac/include/srtp/aes.h @@ -46,8 +46,6 @@ #ifndef _AES_H #define _AES_H -#include "config.h" - #include "datatypes.h" #include "gf2_8.h" #include "err.h" diff --git a/thirdparties/mac/include/srtp/aes_cbc.h b/thirdparties/mac/include/srtp/aes_cbc.h index f92591d..4fda390 100644..100755 --- a/thirdparties/mac/include/srtp/aes_cbc.h +++ b/thirdparties/mac/include/srtp/aes_cbc.h @@ -8,6 +8,42 @@ * */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef AES_CBC_H #define AES_CBC_H diff --git a/thirdparties/mac/include/srtp/aes_gcm_ossl.h b/thirdparties/mac/include/srtp/aes_gcm_ossl.h index 8e7711d..8e7711d 100644..100755 --- a/thirdparties/mac/include/srtp/aes_gcm_ossl.h +++ b/thirdparties/mac/include/srtp/aes_gcm_ossl.h diff --git a/thirdparties/mac/include/srtp/aes_icm.h b/thirdparties/mac/include/srtp/aes_icm.h index bbcc6c3..1a2fd82 100644..100755 --- a/thirdparties/mac/include/srtp/aes_icm.h +++ b/thirdparties/mac/include/srtp/aes_icm.h @@ -8,6 +8,42 @@ * */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef AES_ICM_H #define AES_ICM_H @@ -37,7 +73,7 @@ aes_icm_encrypt(aes_icm_ctx_t *c, err_status_t aes_icm_output(aes_icm_ctx_t *c, - unsigned char *buf, int bytes_to_output); + unsigned char *buf, unsigned int bytes_to_output); err_status_t aes_icm_dealloc(cipher_t *c); @@ -53,5 +89,8 @@ aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp); +uint16_t +aes_icm_bytes_encrypted(aes_icm_ctx_t *c); + #endif /* AES_ICM_H */ diff --git a/thirdparties/mac/include/srtp/aes_icm_ossl.h b/thirdparties/mac/include/srtp/aes_icm_ossl.h index 89da7e0..b4ec40a 100644..100755 --- a/thirdparties/mac/include/srtp/aes_icm_ossl.h +++ b/thirdparties/mac/include/srtp/aes_icm_ossl.h @@ -50,12 +50,21 @@ #include <openssl/evp.h> #include <openssl/aes.h> +#ifdef OPENSSL_IS_BORINGSSL +// BoringSSL doesn't support AES-192, cipher will be disabled +#define SRTP_NO_AES192 +#endif + #define SALT_SIZE 14 #define AES_128_KEYSIZE AES_BLOCK_SIZE +#ifndef SRTP_NO_AES192 #define AES_192_KEYSIZE AES_BLOCK_SIZE + AES_BLOCK_SIZE / 2 +#endif #define AES_256_KEYSIZE AES_BLOCK_SIZE * 2 #define AES_128_KEYSIZE_WSALT AES_128_KEYSIZE + SALT_SIZE +#ifndef SRTP_NO_AES192 #define AES_192_KEYSIZE_WSALT AES_192_KEYSIZE + SALT_SIZE +#endif #define AES_256_KEYSIZE_WSALT AES_256_KEYSIZE + SALT_SIZE typedef struct { @@ -67,6 +76,9 @@ typedef struct { } aes_icm_ctx_t; err_status_t aes_icm_openssl_set_iv(aes_icm_ctx_t *c, void *iv, int dir); +err_status_t aes_icm_openssl_context_init(aes_icm_ctx_t *c, const uint8_t *key, int len); +err_status_t aes_icm_output(aes_icm_ctx_t *c, uint8_t *buffer, int num_octets_to_output); +uint16_t aes_icm_bytes_encrypted(aes_icm_ctx_t *c); #endif /* AES_ICM_H */ diff --git a/thirdparties/mac/include/srtp/alloc.h b/thirdparties/mac/include/srtp/alloc.h index 5980eed..5980eed 100644..100755 --- a/thirdparties/mac/include/srtp/alloc.h +++ b/thirdparties/mac/include/srtp/alloc.h diff --git a/thirdparties/mac/include/srtp/auth.h b/thirdparties/mac/include/srtp/auth.h index 5b5e4b2..5b5e4b2 100644..100755 --- a/thirdparties/mac/include/srtp/auth.h +++ b/thirdparties/mac/include/srtp/auth.h diff --git a/thirdparties/mac/include/srtp/cipher.h b/thirdparties/mac/include/srtp/cipher.h index d0d6b57..d0d6b57 100644..100755 --- a/thirdparties/mac/include/srtp/cipher.h +++ b/thirdparties/mac/include/srtp/cipher.h diff --git a/thirdparties/mac/include/srtp/config.h b/thirdparties/mac/include/srtp/config.h index 263f2de..dfaaa99 100644 --- a/thirdparties/mac/include/srtp/config.h +++ b/thirdparties/mac/include/srtp/config.h @@ -1,6 +1,9 @@ /* crypto/include/config.h. Generated from config_in.h by configure. */ /* config_in.h. Generated from configure.in by autoheader. */ +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + /* Define if building for a CISC machine (e.g. Intel). */ #define CPU_CISC 1 @@ -43,9 +46,18 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +/* #undef HAVE_LIBCRYPTO */ + +/* Define to 1 if you have the `dl' library (-ldl). */ +/* #undef HAVE_LIBDL */ + /* Define to 1 if you have the `socket' library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ +/* Define to 1 if you have the `z' library (-lz). */ +/* #undef HAVE_LIBZ */ + /* Define to 1 if you have the <machine/types.h> header file. */ #define HAVE_MACHINE_TYPES_H 1 @@ -55,6 +67,9 @@ /* Define to 1 if you have the <netinet/in.h> header file. */ #define HAVE_NETINET_IN_H 1 +/* Define to 1 if you have the `pcap' library (-lpcap) */ +#define HAVE_PCAP 1 + /* Define to 1 if you have the `sigaction' function. */ #define HAVE_SIGACTION 1 @@ -118,33 +133,36 @@ /* Define to use X86 inlined assembly code */ #define HAVE_X86 1 +/* Define this to use OpenSSL crypto. */ +/* #undef OPENSSL */ + /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" +#define PACKAGE_BUGREPORT "https://github.com/cisco/libsrtp/issues" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "libsrtp" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "libsrtp 1.5.3" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "libsrtp" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "1.5.3" -/* The size of a `unsigned long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG 4 +/* The size of `unsigned long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG 8 -/* The size of a `unsigned long long', as computed by sizeof. */ +/* The size of `unsigned long long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_LONG 8 /* Define to use GDOI. */ /* #undef SRTP_GDOI */ -/* Define to use OpenSSL crypto. */ -/* #undef OPENSSL */ - /* Define to compile for kernel contexts. */ /* #undef SRTP_KERNEL */ @@ -160,9 +178,17 @@ /* Define to use syslog logging. */ /* #undef USE_SYSLOG */ -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ @@ -173,5 +199,5 @@ /* #undef inline */ #endif -/* Define to `unsigned' if <sys/types.h> does not define. */ +/* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ diff --git a/thirdparties/mac/include/srtp/crypto.h b/thirdparties/mac/include/srtp/crypto.h index 0e9667d..ab6f6be 100644..100755 --- a/thirdparties/mac/include/srtp/crypto.h +++ b/thirdparties/mac/include/srtp/crypto.h @@ -7,6 +7,42 @@ * Cisco Systems, Inc. */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef CRYPTO_H #define CRYPTO_H diff --git a/thirdparties/mac/include/srtp/crypto_kernel.h b/thirdparties/mac/include/srtp/crypto_kernel.h index caccfa0..caccfa0 100644..100755 --- a/thirdparties/mac/include/srtp/crypto_kernel.h +++ b/thirdparties/mac/include/srtp/crypto_kernel.h diff --git a/thirdparties/mac/include/srtp/crypto_math.h b/thirdparties/mac/include/srtp/crypto_math.h index 52f0837..52f0837 100644..100755 --- a/thirdparties/mac/include/srtp/crypto_math.h +++ b/thirdparties/mac/include/srtp/crypto_math.h diff --git a/thirdparties/mac/include/srtp/crypto_types.h b/thirdparties/mac/include/srtp/crypto_types.h index dbb50c3..dbb50c3 100644..100755 --- a/thirdparties/mac/include/srtp/crypto_types.h +++ b/thirdparties/mac/include/srtp/crypto_types.h diff --git a/thirdparties/mac/include/srtp/cryptoalg.h b/thirdparties/mac/include/srtp/cryptoalg.h index d9f0441..d9f0441 100644..100755 --- a/thirdparties/mac/include/srtp/cryptoalg.h +++ b/thirdparties/mac/include/srtp/cryptoalg.h diff --git a/thirdparties/mac/include/srtp/datatypes.h b/thirdparties/mac/include/srtp/datatypes.h index 690e6aa..b18435f 100644..100755 --- a/thirdparties/mac/include/srtp/datatypes.h +++ b/thirdparties/mac/include/srtp/datatypes.h @@ -383,7 +383,7 @@ void octet_string_set_to_zero(uint8_t *s, int len); -#ifndef SRTP_KERNEL_LINUX +#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H) /* * Convert big endian integers to CPU byte order. @@ -509,4 +509,8 @@ bitvector_left_shift(bitvector_t *x, int index); char * bitvector_bit_string(bitvector_t *x, char* buf, int len); +#ifdef TESTAPP_SOURCE +int base64_string_to_octet_string(char *raw, int *pad, char *base64, int len); +#endif + #endif /* _DATATYPES_H */ diff --git a/thirdparties/mac/include/srtp/ekt.h b/thirdparties/mac/include/srtp/ekt.h index b0d888b..b0d888b 100644..100755 --- a/thirdparties/mac/include/srtp/ekt.h +++ b/thirdparties/mac/include/srtp/ekt.h diff --git a/thirdparties/mac/include/srtp/err.h b/thirdparties/mac/include/srtp/err.h index 1a6e170..4f401a6 100644..100755 --- a/thirdparties/mac/include/srtp/err.h +++ b/thirdparties/mac/include/srtp/err.h @@ -46,7 +46,8 @@ #ifndef ERR_H #define ERR_H -#include "datatypes.h" +#include <stdio.h> +#include <stdarg.h> /** * @defgroup Error Error Codes @@ -87,7 +88,7 @@ typedef enum { err_status_nonce_bad = 18, /**< nonce check failed */ err_status_read_fail = 19, /**< couldn't read data */ err_status_write_fail = 20, /**< couldn't write data */ - err_status_parse_err = 21, /**< error pasring data */ + err_status_parse_err = 21, /**< error parsing data */ err_status_encode_err = 22, /**< error encoding data */ err_status_semaphore_err = 23,/**< error while using semaphores */ err_status_pfkey_err = 24 /**< error while using pfkey */ @@ -118,7 +119,7 @@ typedef enum { */ err_status_t -err_reporting_init(char *ident); +err_reporting_init(const char *ident); #ifdef SRTP_KERNEL_LINUX extern err_reporting_level_t err_level; @@ -135,7 +136,7 @@ extern err_reporting_level_t err_level; */ void -err_report(int priority, char *format, ...); +err_report(int priority, const char *format, ...); #endif /* ! SRTP_KERNEL_LINUX */ @@ -145,7 +146,7 @@ err_report(int priority, char *format, ...); typedef struct { int on; /* 1 if debugging is on, 0 if it is off */ - char *name; /* printable name for debug module */ + const char *name; /* printable name for debug module */ } debug_module_t; #ifdef ENABLE_DEBUGGING diff --git a/thirdparties/mac/include/srtp/getopt_s.h b/thirdparties/mac/include/srtp/getopt_s.h index 2a6ece3..2a6ece3 100644..100755 --- a/thirdparties/mac/include/srtp/getopt_s.h +++ b/thirdparties/mac/include/srtp/getopt_s.h diff --git a/thirdparties/mac/include/srtp/gf2_8.h b/thirdparties/mac/include/srtp/gf2_8.h index 098d37c..098d37c 100644..100755 --- a/thirdparties/mac/include/srtp/gf2_8.h +++ b/thirdparties/mac/include/srtp/gf2_8.h diff --git a/thirdparties/mac/include/srtp/hmac.h b/thirdparties/mac/include/srtp/hmac.h index 875f45c..875f45c 100644..100755 --- a/thirdparties/mac/include/srtp/hmac.h +++ b/thirdparties/mac/include/srtp/hmac.h diff --git a/thirdparties/mac/include/srtp/integers.h b/thirdparties/mac/include/srtp/integers.h index 7010efd..ed77210 100644..100755 --- a/thirdparties/mac/include/srtp/integers.h +++ b/thirdparties/mac/include/srtp/integers.h @@ -47,7 +47,6 @@ #ifndef INTEGERS_H #define INTEGERS_H -#include "config.h" /* configuration file, using autoconf */ #ifdef SRTP_KERNEL @@ -76,7 +75,7 @@ #endif /* Can we do 64 bit integers? */ -#ifndef HAVE_UINT64_T +#if !defined(HAVE_UINT64_T) # if SIZEOF_UNSIGNED_LONG == 8 typedef unsigned long uint64_t; # elif SIZEOF_UNSIGNED_LONG_LONG == 8 @@ -99,7 +98,7 @@ typedef unsigned int uint32_t; #endif -#ifdef NO_64BIT_MATH +#if defined(NO_64BIT_MATH) && defined(HAVE_CONFIG_H) typedef double uint64_t; /* assert that sizeof(double) == 8 */ extern uint64_t make64(uint32_t high, uint32_t low); diff --git a/thirdparties/mac/include/srtp/kernel_compat.h b/thirdparties/mac/include/srtp/kernel_compat.h index 59d1898..59d1898 100644..100755 --- a/thirdparties/mac/include/srtp/kernel_compat.h +++ b/thirdparties/mac/include/srtp/kernel_compat.h diff --git a/thirdparties/mac/include/srtp/key.h b/thirdparties/mac/include/srtp/key.h index e7e0744..e7e0744 100644..100755 --- a/thirdparties/mac/include/srtp/key.h +++ b/thirdparties/mac/include/srtp/key.h diff --git a/thirdparties/mac/include/srtp/null_auth.h b/thirdparties/mac/include/srtp/null_auth.h index 44f9a4a..44f9a4a 100644..100755 --- a/thirdparties/mac/include/srtp/null_auth.h +++ b/thirdparties/mac/include/srtp/null_auth.h diff --git a/thirdparties/mac/include/srtp/null_cipher.h b/thirdparties/mac/include/srtp/null_cipher.h index 39da59a..39da59a 100644..100755 --- a/thirdparties/mac/include/srtp/null_cipher.h +++ b/thirdparties/mac/include/srtp/null_cipher.h diff --git a/thirdparties/mac/include/srtp/osx-x264.sh b/thirdparties/mac/include/srtp/osx-x264.sh index 88c0fc2..88c0fc2 100644..100755 --- a/thirdparties/mac/include/srtp/osx-x264.sh +++ b/thirdparties/mac/include/srtp/osx-x264.sh diff --git a/thirdparties/mac/include/srtp/prng.h b/thirdparties/mac/include/srtp/prng.h index c493383..c5ec230 100644..100755 --- a/thirdparties/mac/include/srtp/prng.h +++ b/thirdparties/mac/include/srtp/prng.h @@ -7,6 +7,42 @@ * Cisco Systems, Inc. */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef PRNG_H #define PRNG_H diff --git a/thirdparties/mac/include/srtp/rand_source.h b/thirdparties/mac/include/srtp/rand_source.h index b4c2110..b4c2110 100644..100755 --- a/thirdparties/mac/include/srtp/rand_source.h +++ b/thirdparties/mac/include/srtp/rand_source.h diff --git a/thirdparties/mac/include/srtp/rdb.h b/thirdparties/mac/include/srtp/rdb.h index 2ccb144..300c569 100644..100755 --- a/thirdparties/mac/include/srtp/rdb.h +++ b/thirdparties/mac/include/srtp/rdb.h @@ -8,6 +8,42 @@ */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef REPLAY_DB_H #define REPLAY_DB_H diff --git a/thirdparties/mac/include/srtp/rdbx.h b/thirdparties/mac/include/srtp/rdbx.h index 146fb42..4b8dd22 100644..100755 --- a/thirdparties/mac/include/srtp/rdbx.h +++ b/thirdparties/mac/include/srtp/rdbx.h @@ -8,6 +8,42 @@ * */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef RDBX_H #define RDBX_H diff --git a/thirdparties/mac/include/srtp/rtp.h b/thirdparties/mac/include/srtp/rtp.h index 0e0119c..0e0119c 100644..100755 --- a/thirdparties/mac/include/srtp/rtp.h +++ b/thirdparties/mac/include/srtp/rtp.h diff --git a/thirdparties/mac/include/srtp/rtp_priv.h b/thirdparties/mac/include/srtp/rtp_priv.h index 1421386..1421386 100644..100755 --- a/thirdparties/mac/include/srtp/rtp_priv.h +++ b/thirdparties/mac/include/srtp/rtp_priv.h diff --git a/thirdparties/mac/include/srtp/sha1.h b/thirdparties/mac/include/srtp/sha1.h index 8b02f76..f1744ce 100644..100755 --- a/thirdparties/mac/include/srtp/sha1.h +++ b/thirdparties/mac/include/srtp/sha1.h @@ -47,9 +47,14 @@ #ifndef SHA1_H #define SHA1_H +#ifdef HAVE_CONFIG_H + #include <config.h> +#endif + #include "err.h" #ifdef OPENSSL #include <openssl/evp.h> +#include <stdint.h> typedef EVP_MD_CTX sha1_ctx_t; @@ -67,18 +72,18 @@ typedef EVP_MD_CTX sha1_ctx_t; * */ -void inline sha1_init (sha1_ctx_t *ctx) +static inline void sha1_init (sha1_ctx_t *ctx) { EVP_MD_CTX_init(ctx); EVP_DigestInit(ctx, EVP_sha1()); } -void inline sha1_update (sha1_ctx_t *ctx, const uint8_t *M, int octets_in_msg) +static inline void sha1_update (sha1_ctx_t *ctx, const uint8_t *M, int octets_in_msg) { EVP_DigestUpdate(ctx, M, octets_in_msg); } -void inline sha1_final (sha1_ctx_t *ctx, uint32_t *output) +static inline void sha1_final (sha1_ctx_t *ctx, uint32_t *output) { unsigned int len = 0; diff --git a/thirdparties/mac/include/srtp/srtp.h b/thirdparties/mac/include/srtp/srtp.h index 11ea33d..81af519 100644..100755 --- a/thirdparties/mac/include/srtp/srtp.h +++ b/thirdparties/mac/include/srtp/srtp.h @@ -50,7 +50,10 @@ extern "C" { #endif -#include "crypto_kernel.h" +#include <stdint.h> +#include "crypto.h" +#include "crypto_types.h" +#include "err.h" /** * @defgroup SRTP Secure RTP @@ -76,7 +79,7 @@ extern "C" { * SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP */ -#define SRTP_MAX_TAG_LEN 12 +#define SRTP_MAX_TAG_LEN 16 /** * SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer @@ -99,6 +102,7 @@ extern "C" { #define AES_256_GCM_KEYSIZE_WSALT SRTP_AEAD_SALT_LEN + 32 + /* * nota bene: since libSRTP doesn't support the use of the MKI, the * SRTP_MAX_TRAILER_LEN value is just the maximum tag length @@ -358,8 +362,7 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); * @warning This function assumes that the SRTP packet is aligned on a * 32-bit boundary. * - * @param ctx is a pointer to the srtp_t which applies to the - * particular packet. + * @param ctx is the SRTP session which applies to the particular packet. * * @param srtp_hdr is a pointer to the header of the SRTP packet * (before the call). after the function returns, it points to the @@ -392,7 +395,8 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr); * initializes an SRTP session context, applying the given policy and * key. * - * @param session is the SRTP session to which the policy is to be added. + * @param session is a pointer to the SRTP session to which the policy is + * to be added. * * @param policy is the srtp_policy_t struct that describes the policy * for the session. The struct may be a single element, or it may be @@ -1083,6 +1087,57 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); * @} */ + +/** + * @defgroup User data associated to a SRTP session. + * @ingroup SRTP + * + * @brief Store custom user data within a SRTP session. + * + * @{ + */ + +/** + * @brief srtp_set_user_data() stores the given pointer into the SRTP + * session for later retrieval. + * + * @param ctx is the srtp_t context in which the given data pointer is + * stored. + * + * @param data is a pointer to the custom information (struct, function, + * etc) associated with the SRTP session. + * + * @return void. + * + */ + +void +srtp_set_user_data(srtp_t ctx, void *data); + +/** + * @brief srtp_get_user_data() retrieves the pointer to the custom data + * previously stored with srtp_set_user_data(). + * + * This function is mostly useful for retrieving data associated to a + * SRTP session when an event fires. The user can then get such a custom + * data by calling this function with the session field of the + * srtp_event_data_t struct as argument. + * + * @param ctx is the srtp_t context in which the given data pointer was + * stored. + * + * @return void* pointer to the user data. + * + */ + +void* +srtp_get_user_data(srtp_t ctx); + +/** + * @} + */ + + /** * @defgroup SRTPevents SRTP events and callbacks * @ingroup SRTP @@ -1184,6 +1239,18 @@ err_status_t srtp_install_event_handler(srtp_event_handler_func_t func); /** + * @brief Returns the version string of the library. + * + */ +const char *srtp_get_version_string(void); + +/** + * @brief Returns the numeric representation of the library version. + * + */ +unsigned int srtp_get_version(void); + +/** * @} */ /* in host order, so outside the #if */ diff --git a/thirdparties/mac/include/srtp/srtp_priv.h b/thirdparties/mac/include/srtp/srtp_priv.h index 2b90a44..170df5b 100644..100755 --- a/thirdparties/mac/include/srtp/srtp_priv.h +++ b/thirdparties/mac/include/srtp/srtp_priv.h @@ -45,10 +45,20 @@ #ifndef SRTP_PRIV_H #define SRTP_PRIV_H +#include "config.h" #include "srtp.h" #include "rdbx.h" #include "rdb.h" #include "integers.h" +#include "crypto.h" +#include "cipher.h" +#include "auth.h" +#include "aes.h" +#include "key.h" +#include "crypto_kernel.h" + +#define SRTP_VER_STRING PACKAGE_STRING +#define SRTP_VERSION PACKAGE_VERSION /* * an srtp_hdr_t represents the srtp header @@ -88,7 +98,7 @@ typedef struct { unsigned char x:1; /* header extension flag */ unsigned char cc:4; /* CSRC count */ unsigned char m:1; /* marker bit */ - unsigned pt:7; /* payload type */ + unsigned char pt:7; /* payload type */ uint16_t seq; /* sequence number */ uint32_t ts; /* timestamp */ uint32_t ssrc; /* synchronization source */ @@ -233,6 +243,7 @@ typedef struct srtp_stream_ctx_t { typedef struct srtp_ctx_t { srtp_stream_ctx_t *stream_list; /* linked list of streams */ srtp_stream_ctx_t *stream_template; /* act as template for other streams */ + void *user_data; /* user custom data */ } srtp_ctx_t; diff --git a/thirdparties/mac/include/srtp/stat.h b/thirdparties/mac/include/srtp/stat.h index e28b131..e28b131 100644..100755 --- a/thirdparties/mac/include/srtp/stat.h +++ b/thirdparties/mac/include/srtp/stat.h diff --git a/thirdparties/mac/include/srtp/ut_sim.h b/thirdparties/mac/include/srtp/ut_sim.h index c25feeb..c25feeb 100644..100755 --- a/thirdparties/mac/include/srtp/ut_sim.h +++ b/thirdparties/mac/include/srtp/ut_sim.h diff --git a/thirdparties/mac/include/srtp/xfm.h b/thirdparties/mac/include/srtp/xfm.h index 5837149..80774f9 100644..100755 --- a/thirdparties/mac/include/srtp/xfm.h +++ b/thirdparties/mac/include/srtp/xfm.h @@ -7,6 +7,42 @@ * Cisco Systems, Inc. */ +/* + * + * Copyright (c) 2001-2006, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef XFM_H #define XFM_H |