summaryrefslogtreecommitdiff
path: root/stun
Commit message (Collapse)AuthorAgeFilesLines
* stun: Disable debug by defaultPhilip Withnall2015-09-041-1/+1
| | | | | | | To match debug_enable in agent/debug.c. Debug can still be enabled by calling stun_debug_enable() or nice_debug_enable(). Spotted on the mailing list by Tom Chen.
* ms-turn: don't wait for a reply to STUN_SEND requestJakub Adam2015-09-021-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | As per [MS-TURN] Section 2.2.1, TURN message type 0x0104 "Send request response" isn't supported and the TURN server MUST NOT send them. Thus, libnice should not remember Send requests in agent->sent_ids because without replies coming, the number of allowed pending transaction gets quickly exhausted, causing our data packets to be dropped until a request timeout frees some space in the queue. This behavior resulted in choppy reception of our audio on a Lync client when connected via Lync Edge (TURN) Server. Maniphest Tasks: T126 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D223
* stun: Remove annoying non-error on non-STUN packetOlivier Crête2015-06-241-1/+0
|
* stun: Add missing casts to unit testsPhilip Withnall2015-04-231-3/+6
| | | | This fixes some compiler warnings.
* stunagent: Initiliaze variableOlivier Crête2015-04-201-1/+1
| | | | This remove a gcc warning
* stun: Add missing format attributes for va_list printf functionsPhilip Withnall2015-04-142-0/+14
| | | | As detected by GCC 4.9.
* stun: Fix documentation to use ‘nul-terminated’ for stringsPhilip Withnall2015-03-101-3/+3
| | | | | NULL is ((gpointer) 0). nul is '\0'. Arrays can be NULL terminated. Strings can be nul terminated.
* stun: Use dynamic array instead of stack allocated arrayDavid Feurle2015-02-111-1/+3
| | | | | | | Dynamic on-stack arrays are not supported in Visual Studio. This has the downside of introducing an extra memory allocation into libstun, but it’s on a debug path so should be harmless.
* stun: Use sprintf() instead of snprintf() to support VS 2010Philip Withnall2015-02-111-1/+1
| | | | | | | | | | | | | | Visual Studio 2010 still doesn’t support C99, and snprintf() is a C99 function, so compilation fails with: error: C3861: 'snprintf': identifier not found Use sprintf() instead, which is C89 and thus supported. This does not make the code unsafe, as the format specifier is constrained to two characters (+ trailing nul), which are guaranteed to fit in the array bounds. Reported on the mailing list: http://lists.freedesktop.org/archives/nice/2014-October/000978.html
* docs: Add various missing documentation comments and update sections.txtPhilip Withnall2015-01-025-1/+165
| | | | | This straightens out the last few bits of the documentation and almost allows `make check` to pass in docs/.
* stun: Rename a symbol to avoid a naming clash with OpenSSLCurieux Tres2014-10-273-4/+4
| | | | | | | | | The symbol is not exported, but nevertheless leaks in the static version of libnice, due to limitations on symbol visibilities with static libraries. OpenSSL has a symbol named RAND_bytes(), which ours clashes with if the two are linked together statically. Avoid this by prefixing ours with ‘nice_’.
* stun: Make a warning message more prominentPhilip Withnall2014-09-011-1/+1
| | | | | | Since dropping a STUN message due to having insufficient buffer space in libstun can cause ICE negotiation to fail. So we want it to be more obvious in the logs.
* stun: Fix definition of ssize_t on WindowsPhilip Withnall2014-08-181-2/+12
| | | | ssize_t should definitely be signed, not unsigned.
* debug: Make debug messages ready for g_log()Olivier Crête2014-07-238-94/+116
| | | | | | Send thing one line at a time, so no explicit \n Also make it possible to set a log handler explicitly
* Check error code 438 for TURN Nonce expiredLivio Madaro2014-07-221-1/+1
|
* Use sockaddr for stun_usage_bind_process in unit testYouness Alaoui2014-07-221-6/+11
|
* stunmessage: Accept NULL terminated buffers for fast speed validationOlivier Crête2014-05-172-5/+7
|
* Add support for MS-TURN in OC2007 compatibility turn usageYouness Alaoui2014-05-152-2/+27
|
* stunmessage: Revert another function to use sockaddrOlivier Crête2014-05-025-10/+13
| | | | The farstream unit tests were using it.
* stunagent: Only declare the long term key valid if the username/realm coudl ↵Olivier Crête2014-04-241-2/+2
| | | | be read
* stun: Restore argument type to stun_usage_bind_process(), it's used outside ↵Olivier Crête2014-04-152-9/+11
| | | | libnice
* Fix possible segfault in stun_message_validate_buffer_length()Jakub Adam2014-04-041-1/+10
|
* build: Check for [s]size_t before redefining them on MinGWPhilip Withnall2014-04-031-1/+4
| | | | | | MinGW defines size_t and ssize_t for us, so we should not unconditionally redefine them in stun/win32_common.h. Add an AC_CHECK_TYPES configure check to avoid this.
* stun: Use struct sockaddr_storage * for any pointer that we write toOlivier Crête2014-03-3116-142/+134
| | | | | | Some platforms have a larger alignment requirement for struct sockaddr_* than for plain struct sockaddr, in that case, we need to make sure that the incoming pointer has the right alignement before taking it in.
* stun tests: Fix a bunch of issues found by more aggressive GCC warningsOlivier Crête2014-03-314-52/+57
|
* stun: Add a fast version of stun_message_validate_buffer_length()Philip Withnall2014-01-312-13/+107
| | | | | | | | | | | | | | stun_message_validate_buffer_length() is already fast, but requires the entire message to be in a single monolithic buffer. For introducing vectored I/O, this becomes impossible to guarantee. Rather than rewriting the STUN code to natively support vectors of buffers (which would be a huge undertaking, and would probably slow the code down considerably), implement a fast check of whether a message is likely to be a STUN packet which *does* support vectored I/O. This can then be used to determine whether to compact the vector of buffers to a single monolithic one in order to validate the message more thoroughly.
* stun: Use SHA1 iteration functions directly in HMAC calculationPhilip Withnall2014-01-311-53/+26
| | | | | | | | | Rather than using an intermediate method which takes a vector of buffers, just use the SHA1 iteration functions directly in the HMAC calculations. This eliminates several cases where the vector of buffers was of fixed length, and it was actually taking more code to set up and pass the vector than it would have to call the iteration functions directly.
* stun: Add missing switch casesPhilip Withnall2014-01-312-0/+11
| | | | | | | | This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
* stun: Fix potential zero-length memset() callPhilip Withnall2014-01-311-3/+5
| | | | GCC warns about this. Might as well prevent the warning.
* stun: Make the MD5 code strict-aliasing correctOlivier Crête2014-01-312-16/+19
|
* stun: Add printf function attributePhilip Withnall2014-01-021-0/+7
| | | | | This shuts a compiler warning up and allows for format string checking of debug messages.
* stun: Fix format specifier for a size_t variablePhilip Withnall2014-01-021-1/+2
| | | | | | | | | This fix may not be entirely cross-platform, and I have been unable to test whether it is; making it cross-platform is made more difficult by the fact that the STUN code doesn’t use GLib. The PRIuPTR macro was defined in POSIX:2004, and later in C99. http://pubs.opengroup.org/onlinepubs/009696799/basedefs/inttypes.h.html
* configure: Verify that the compiler understands warning cflagsOlivier Crête2013-12-262-2/+2
| | | | Older compilers don't understand all of the flags
* stun: Indications are never authentication when using long term authOlivier Crête2013-12-231-1/+2
|
* stun: Fix a use of a function with an aggregate return valuePhilip Withnall2013-12-182-6/+5
| | | | | | | | | | div() has an aggregate return, which GCC doesn’t like, although this seems like a pretty pointless warning because div_t is the same size as a pointer on 64-bit platforms (probably) and hardly going to cause performance problems by passing it by value. Anyway, it seems easier to simplify the code by using explicit / and % operators inline, than it does to add pragmas and shut the warning up.
* stun: Explicitly avoid a memcpy() from NULLPhilip Withnall2013-12-181-1/+3
| | | | | | | | | | | | If stun_message_append_bytes() is called through stun_message_append_flag(), data will be NULL and len will be 0. This will result in a memcpy(ptr, NULL, 0) call. This probably won’t do any harm (since any reasonable memcpy() implementation will immediately return if (len == 0)), but the standard allows for memcpy() to explode if (data == NULL), regardless of the value of len. In order to be conformant, and to shut up the scan-build static analysis warning about it, only do the memcpy() if (len > 0).
* stun: Remove unused variablesPhilip Withnall2013-12-181-2/+0
|
* Fix strict aliasing of sockaddr structuresPhilip Withnall2013-12-186-37/+66
| | | | | | | | | | | | Casting from one struct sockaddr type to another breaks C’s strict aliasing rules (variables of different types cannot alias). Fix this cleanly by using unions of struct sockaddrs to convert between the types (i.e. type-punning). I wish sockaddr didn’t have to be this painful. See: http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
* Add missing ‘default’ cases to switchesPhilip Withnall2013-12-186-3/+36
| | | | | | | This shuts GCC’s -Wswitch-default warning, and makes the code flow a little more explicit. This introduces no functional changes.
* Use %lu for long unsigned int when calling printfRohan Garg2012-05-011-1/+1
|
* Use len instead of buf_len to check whether or not data was received properlyRohan Garg2012-03-231-1/+1
|
* Properly ifdef windows headers in order to get compiles working on linux againRohan Garg2012-03-121-1/+1
|
* Fixed mingw/msys compilation. Definition for intptr_t was missingFilippo Della Betta2012-03-051-0/+1
|
* Fixed compiling on Visual Studio and removed getsockname before bind. Added ↵Filippo Della Betta2012-03-051-12/+23
| | | | WSAStartup/WSACleanup on win32
* Fixed compile on mingw/msys platformFilippo Della Betta2012-03-051-0/+5
|
* set nonblocking mode for socket on WindowsLivio Madaro2012-02-231-0/+6
|
* Fixed warnings on Visual Studio platformFilippo Della Betta2012-02-171-1/+1
|
* Added typedef on size_t and ssize_t that are not defined on Visual Studio ↵Filippo Della Betta2012-02-151-0/+5
| | | | platform
* Included the replacement header win32_common.h instead of the missing header ↵Filippo Della Betta2012-02-151-0/+4
| | | | stdint.h on WIN32 platform
* Use size of the MD5Context, not size of the pointerRohan Garg2012-02-141-1/+1
|