summaryrefslogtreecommitdiff
path: root/stun
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* stund: Use recvfrom/sendto instead of recvmsg/sendmsgYouness Alaoui2012-02-091-67/+15
|
* stund: Set message length (fixes infinite loop) when receiving unknown ↵John Selbie2012-02-091-1/+1
| | | | attributes
* Changes windows specific headers to lower caseSiraj Razick2011-12-191-1/+1
| | | | This helps us when cross compiling libnice for Windows from Linux
* Add support for windows's compilation through MinGWNader Morshed2011-11-309-15/+25
|
* Remove warnings on stun/testsTimothy Redaelli2011-10-131-1/+2
|
* Fix support for solarisApostolos Syropoulos2011-09-071-0/+4
|
* Google puts the STUN cookie, but doesn't follow RFC 5389Olivier Crête2011-08-291-1/+2
| | | | | Google puts the stun cookie, but it doesn'T follow RFC 5389 at all, so ignore the STUN cookie in Google mode.
* Avoid a possible coverity false positiveYouness Alaoui2011-03-231-0/+2
|
* Change variable buffer_len into attribute_len: variable already exists in ↵Youness Alaoui2011-03-231-5/+5
| | | | different scope
* Add some new APIs to sha1 module, unused for nowYouness Alaoui2011-03-232-9/+75
|
* Fix coverity issues, remove possibly NULL dereferencingYouness Alaoui2011-03-231-2/+4
|
* Also initialize the number of timer retransmissionsSjoerd Simons2011-02-091-0/+1
|
* define SOL_IPV6 to IPPROTO_IPV6 if not definedYouness Alaoui2011-01-172-0/+11
|
* Refuse to create a permission without a peer instead of not sending the ↵Youness Alaoui2010-12-171-5/+6
| | | | XOR_PEER_ADDRESS
* Some minor changes, code cleaningYouness Alaoui2010-12-162-2/+1
|
* Fix lines that are > 80 charsYouness Alaoui2010-12-141-1/+2
|
* Fix compilation errors as a result of the rebaseYouness Alaoui2010-12-141-1/+1
|
* fix indentation issuesYouness Alaoui2010-12-141-34/+34
|