Commit Graph

106 Commits

Author SHA1 Message Date
William King
51f2442a9e resolve an automake warning about subdirs on latest automake
Latest automake will detect then warn if the Makefile uses source
files that are in subdirectories, but the subdirs option is not
set. In the FreeSWITCH build system the current expected behavior is
to expect the subdirs option to be enabled.

FS-7122 #resolve
2015-01-07 10:04:29 -08:00
Jeff Lenk
b3d71917d2 FS-6870 #comment vs2010 and vs2012 would rather fix it this way 2014-10-01 17:53:51 -05:00
Jeff Lenk
661269a46f Revert "FS-6870 #vs2012 and vs2010 make download of openssl dependent"
This reverts commit a39db86863.
2014-10-01 17:49:21 -05:00
Jeff Lenk
a39db86863 FS-6870 #vs2012 and vs2010 make download of openssl dependent 2014-09-30 21:30:48 -05:00
Peter Wu
98502947c8 libsrtp: do not include unnecessary sources
These two files should only be built when OpenSSL is not enabled. See
the configure script of the original sources and Makefile from upstream.
(RNG_EXTRA_OBJS)

Fixes a -Wimplicit-function-declaration warning.
2014-08-13 18:52:18 +00:00
Peter Olsson
17d6c5b850 FS-6578 #comment fixed #resolve 2014-07-19 18:06:01 +02:00
Michael Jerris
a99f06dfc6 sync changes from srtp upstream 2014-07-08 10:26:08 -04:00
jfigus
024162cfc9 Add support for 16-byte auth tag for AES GCM mode. 2014-06-30 19:18:20 +00:00
jfigus
b9da5149e2 Set the algorithm member on cipher_t when allocating AES crypto instance. Apply same fix to NULL cipher. 2014-06-30 19:18:20 +00:00
Travis Cross
aa4261d11f Avoid buffer-overflow on short RTCP/SRTCP packets
In `srtp_unprotect_rtcp()` we are not validating that the packet
length is as long as the minimum required.  This would cause
`enc_octet_len` to underflow, which would cause us to try to decrypt
data past the end of the packet in memory -- a buffer over-read and
buffer overflow.

In `srtp_protect_rtcp()`, we were similarly not validating the packet
length.  Here we were also polluting the address of the SRTCP
encrypted flag and index (the `trailer`), causing us to write one word
to a bogus memory address before getting to the encryption where we
would also overflow.

In this commit we add checks to appropriately validate the RTCP/SRTCP
packet lengths.

`srtp_unprotect_rtcp_aead()` (but not protect) did correctly validate
the packet length; this check would now be redundant as the check in
`srtcp_unprotect_rtcp()` will also run first, so it has been removed.
2014-06-30 19:00:35 +00:00
Travis Cross
9ea93c4c50 Avoid buffer over-read on null cipher AEAD
In the defined AEAD modes, SRTP packets must always be encrypted and
authenticated, but SRTCP packets may be only authenticated.  It's
possible, therefore, for us to end up in `srtp_protect_aead()` without
the `sec_serv_conf` bit being set.  We should just ignore this and
encrypt the RTP packet anyway.

What we are doing instead is encrypting the packet anyway, but setting
`enc_start` to NULL first.  This causes `aad_len` to underflow which
will cause us to over-read in `cipher_set_aad()`.

If we could get past that, we would try to read and write memory
starting at 0x0 down in `cipher_encrypt()`.

This commit causes us to not check the `sec_serv_conf` bit and never
set `enc_start` to NULL in `srtp_protect_aead()`.

`srtp_unprotect_aead()` does not contain a similar error.
2014-06-30 19:00:35 +00:00
Travis Cross
3bf2b9af75 Prevent buffer overflow from untrusted RTP/SRTP lengths
When computing the start address of the RTP data to encrypt or SRTP
data to decrypt (`enc_start`), we are using `hdr->cc` (the CSRC
count), which is untrusted data from the packet, and the length field
of an RTP header extension, which is also untrusted and unchecked data
from the packet.

This value then pollutes our calculation of how much data we'll be
encrypting or decrypting (`enc_octet_len`), possibly causing us to
underflow.

We'll then call `cipher_encrypt()` or `cipher_decrypt()` with these
two values, causing us to read from and write to arbitrary addresses
in memory.

(In the AEAD functions, we'd also pollute `aad_len`, which would cause
us to read undefined memory in `cipher_set_aad`.)

This commit adds checks to verify that the `enc_start` we calculate is
sane based on the actual packet length.
2014-06-30 19:00:35 +00:00
Travis Cross
d2aaf15992 Fix misspelling in comment 2014-06-30 19:00:34 +00:00
Peter Olsson
295964f0ec FS-6457 --resolve
Upgrade to OpenSSL 1.0.1g in Windows build (Visual Studio 2010 and 2012)
2014-04-13 10:01:17 +02:00
Anthony Minessale
53c77f8434 force srtp rebuild 2014-04-09 03:14:52 +05:00
Dmitry Sobinov
80e203442a - fixed read of memory out of 'seq' variable bounds
- fixed AEAD IV calculation for big-endian machines
2014-04-08 16:13:52 +00:00
jfigus
a31491d5b6 This commit resolves issue #46. The GCM mode was using the wrong master SALT length. The master SALT should be 96 bits instead of 112 bits. Note, GCM mode uses the legacy CTR mode for the KDF. The legagacy CTR mode cipher implementations assume a 112 bit SALT. Changes to the cipher abstraction layer API are required to provide the ability to specify the SALT length. For now this commit modifies the SRTP layer to ensure the SALT is zero-appended before initializing the KDF. This commit also provides public definitions for the GCM cipher suite master key sizes to avoid confusion for application developers. 2014-04-08 15:25:39 +00:00
Michael Jerris
4216e3e056 remove DYNAMIC_LIB_EXTEN because we use libtool to figure this all out now 2014-03-14 18:04:07 -04:00
Michael Jerris
2513388d8a clean up some bootstrap warnings 2014-03-07 18:36:26 -05:00
Travis Cross
38fe0a99d3 Prevent sha1_init et al from being undefined
sha1_init, sha1_update, and sha1_final were ending up as undefined
symbols in libfreeswitch.so because of the inline declaration, which
caused us to blow up while linking the freeswitch executable.  Declare
these as static inline instead.
2014-02-28 18:33:32 +00:00
Travis Cross
c011f9daff Remove binary executables in libs/srtp
These files were introduced in commit 72e2d183c1.
2014-02-28 18:33:32 +00:00
Seven Du
4fd93b0e67 Revert "fix compiler warning vs2010" - Jeff is faster than I
This reverts commit fa9217117a.
2014-02-25 14:24:34 +08:00
Seven Du
fa9217117a fix compiler warning vs2010 2014-02-25 14:17:28 +08:00
Jeff Lenk
4a1f8785e4 mask warnings libsrtp windows 32bit 2014-02-24 22:42:16 -06:00
Jeff Lenk
99ab915f24 windows update libsrtp to use openssl 2014-02-24 20:13:12 -06:00
Michael Jerris
6e97a9f55b FS-6017: --resolve no reason to have extra check for cross compile 2014-02-24 17:43:21 -05:00
Michael Jerris
e9a0a0edc9 fix asm issue on sun 2014-02-24 15:28:03 -05:00
Michael Jerris
bab923923a missed file 2014-02-24 10:32:34 -05:00
Michael Jerris
80c7eb85e6 update libsrtp to use openssl 2014-02-24 09:52:25 -05:00
Brian West
0c7946bfec DragonFly and NetBSD sigh 2014-02-23 20:25:05 -06:00
Michael Jerris
bbb96f936f fix openbsd build issue 2014-02-21 15:20:08 -05:00
Jeff Lenk
d5324cfdb3 disable windows compiler warning for srtp 2014-02-09 10:37:14 -06:00
Peter Olsson
d655031534 Improvements to last commit, this should make things work better on all platforms 2014-02-09 14:19:36 +01:00
Peter Olsson
05144df25a FS-6194 --resolve 2014-02-09 13:10:44 +01:00
Jeff Lenk
998b656799 remove some _MSC_VER stuff 2014-01-31 12:35:55 -06:00
Jeff Lenk
558decda2c srtp fix cast for last round of fixes 2014-01-31 11:19:30 -06:00
Jeff Lenk
37a639860c revert last srtp change and fix for windows different 2014-01-31 10:53:33 -06:00
Jeff Lenk
7454350062 missed one on last commit 2014-01-31 09:16:20 -06:00
Jeff Lenk
035985859c reapply several compiler fixes after last commit 2014-01-31 08:54:26 -06:00
Michael Jerris
91eb5b237d update srtp to master part 1 2014-01-30 16:55:56 -05:00
Michael Jerris
16c9c1df0a don't define inline to nothing 2014-01-30 08:54:03 -05:00
Michael Jerris
433830a3fe revert previous change that does not correct the issue. opened a bug with apple on this issue https://bugreport.apple.com/problem/viewproblem #15938497 2014-01-29 16:59:55 -05:00
Michael Jerris
8a01410847 FS-5956: fix __sputc included twice due to stdio.h inlining issue 2014-01-29 11:41:49 -05:00
Peter Olsson
5a820fdc78 Disabled some compiler warnings on Windows build (for Visual Studio 2012), also disabled code analysis one some projects. This should make the Windows build more clean in the future. 2014-01-22 22:47:11 +01:00
Anthony Minessale
d3872b3a7b add diffs from 8884f4d 8e47faf @ https://github.com/cisco/libsrtp 2014-01-11 03:46:13 +05:00
Michael Jerris
1cd58ddba8 FS-5564: fix gcc extension for unsigned char bitfield type 2013-08-13 15:40:33 -04:00
Jeff Lenk
f37467e054 FS-5507 this should fix but I'm not sure its the proper thing 2013-06-17 08:51:56 -05:00
Michael Jerris
d7c34c7e1f FS-5250: --resolve fix mac build 2013-04-10 12:50:19 -04:00
Jeff Lenk
2cef8580a0 oops line endings 2013-04-04 19:41:41 -05:00
Jeff Lenk
231effa3b0 windows correct srtp 2013-04-04 19:35:57 -05:00