Commit Graph

177 Commits

Author SHA1 Message Date
Kang Lin
40c99db6ba
Support Windows MSVC (#855)
The following changes have been made:
1. Replace deprecated functions with new standard functions
2. Add corresponding MSVC functions for non-standard functions 
3. Remove warnings about unsafe functions
4. CMAKE: modify find pack Libevent and openssl 
5. Modify include files
6. Use pthread4W
7. Modify socket in windows
8. Add CI - github action
8.1. msvc
8.2. mingw
10. The database:
9.1. sqlite, pgsql, hiredis, mongo  is test compiled.
9.2. mysql, isnot test compiled.
11. The applications、server can be compiled and run successfully! 
12. Add vcpkg manifest mode in cmake.
2022-10-28 19:32:23 -07:00
Gregor Jasny
6f14716149
Use %zu format specifier for size_t (#1040) 2022-10-24 22:34:48 +02:00
Pavel Punsky
d9e74af75d
Cleanup unused include of header files (#1004)
Using clang-tidy to detect unused header files

Inspired by #855

Test Plan:
- Rebuild all on mac, review no warnings/errors
- Pass builds/docker build - review for no issues
2022-10-05 10:28:40 +02:00
Tom Bevan
9a6393e908
Malformed response to mobility refresh request (#1006)
Hello, and thank you for this great project!

When sending a mobility refresh request, the server is responding with
an invalid stun packet. Specifically, only the last 24 bytes generated
for message integrity are sent.

Request:

![image](https://user-images.githubusercontent.com/4522385/193647719-c9038761-86fe-4eb3-b899-20cdd5084796.png)

Response:

![image](https://user-images.githubusercontent.com/4522385/193647883-31c919e0-f7ae-4db2-9b82-028bd8cdb24f.png)


This appears to be caused by the buffer length not being updated when
`STUN_ATTRIBUTE_SOFTWARE` is added to the response, as it's being
assigned to a `len` variable scoped to that conditional.

As a result, the next call to `stun_get_command_message_len_str` when
handling message integrity returns `-1` and resizes the buffer, etc.

Passing in the original `len` to `stun_attr_add_str` for attribute
software fixes the issue, but apologies if this is not the right way to
fix this!
2022-10-05 10:24:45 +02:00
Pavel Punsky
bd9e44dd7c
Replace bcopy with memcpy (#991)
Replace all instances of `bcopy` with memcpy.

Inspired by https://github.com/coturn/coturn/pull/855
2022-09-20 10:39:11 +02:00
Pavel Punsky
ae259637eb
Replace bzero with memset (#986)
Replace all instances of `bzero` with memset by find-replace-edit.
This is straightforward replacement which is suboptimal in a few cases
(for example we could use calloc instead of malloc+memset(0))

Inspired by #855
2022-09-17 08:36:28 +02:00
huhaipeng
f22376ce29 fix turn session leak 2022-08-26 11:17:13 +08:00
Mészáros Mihály
6492f51a63
Merge pull request #767 from ggalperi/patch-1
Fix server->log_binding usage
2021-06-17 12:57:45 +02:00
Mészáros Mihály
7ad04a37d6 Not send SOFTWARE attr, if no_sotware_attribute on 2021-06-05 22:10:31 +02:00
Mészáros Mihály
708b83ea78 RESPONSE_ORIGIN attribute only if rfc5780 is on 2021-06-05 22:10:31 +02:00
Mészáros Mihály
54ef051844 Disable stun backward compatibility 2021-06-05 22:10:31 +02:00
ggalperi
0ac3fda6dd
Fix server->log_binding usage
The server->log_binding ptr should be dereferenced
2021-05-14 16:34:52 -04:00
Mészáros Mihály
2204778ce1 Replace keep-address-family with allocation-default-address-family 2021-03-12 23:05:18 +01:00
Mészáros Mihály
abfe1fd08d Merge branch 'advisory-fix-1' CVE-2020-26262 2021-01-10 20:59:14 +01:00
Mészáros Mihály
2edc14a193 Fixes #601 2021-01-07 21:38:43 +00:00
Mészáros Mihály
13082beae8 Fixes #600 2021-01-07 21:31:12 +00:00
Mészáros Mihály
9fcd86f3cc Fixes #621 2021-01-07 21:25:27 +00:00
Mészáros Mihály
27b261eb58 Disable binding logging to avoid DoS attack
* Add new option log-binding
2021-01-05 09:55:55 +00:00
Mészáros Mihály
86b78aa6fa Tidy: fix spacing 2021-01-05 07:44:58 +00:00
Mészáros Mihály
ae541958cd Tidy: remoe trailing space 2020-12-18 08:22:02 +00:00
Mészáros Mihály
2f790ec18b Tidy acme code 2020-12-18 08:06:25 +00:00
Mészáros Mihály
d4686750ee Move acme to new file 2020-12-15 13:04:11 +00:00
Jens Elkner
7e525c8e1c support of --acme-redirect <URL> 2020-12-15 13:01:51 +00:00
Mészáros Mihály
9c7deff4b8 Separate addr zero check from allow_loopback_peers 2020-12-07 14:28:23 +01:00
Sandro Gauci
649cbf9661 fixed logic for banning loopback and zero addr 2020-12-07 12:27:25 +01:00
Mészáros Mihály
560684c894 Tidy: Move zero check to own function 2020-12-07 08:32:09 +01:00
Danilo Bargen
520e172b22 Rename "prod" config option to "no-software-attribute"
As discussed in https://github.com/coturn/coturn/pull/478, if the
parameter only controls whether or not to send the software attribute
and not other production-relevant configurations, it should be named
accordingly.

The old --prod configuration option still works, but is now deprecated
and undocumented.
2020-03-13 11:03:05 +01:00
Zebadiah Long
8bf70a1199 added bandwidth usage reporting for bandwidth used by peers 2019-05-21 12:30:12 +02:00
Bradley T. Hughes
d2ee3ac291 Remove [su]{08,16,32,64}bits type defines
Do not overload the standard types with #defines, just use them
directly.
2019-03-08 09:08:30 +01:00
Bradley T. Hughes
7a43aae7c3 Remove ns_bzero(), ns_bcopy(), and ns_bcmp()
Do not overload bzero(), bcopy(), and bcmp() from strings.h
2019-03-07 08:39:20 +01:00
Bradley T. Hughes
b50fc77124 Remote turn_free()
Do not overload free() with a different API.
2019-03-07 07:58:12 +01:00
Bradley T. Hughes
31033c3ffa Remote turn_realloc()
Do not overload realloc() with a different API.
2019-03-07 07:57:35 +01:00
Bradley T. Hughes
fef016901e Remove turn_malloc()
Do not overload malloc() from stdlib.h
2019-03-06 23:38:20 +01:00
Mészáros Mihály
e4d6b57abc Realm not sanitized against sql statements 2018-12-07 13:48:05 +01:00
Mészáros Mihály
b77c1c3557 Close http/https socket immediately on worker,
if web_admin_listen_on_workers is not allowed.
2018-12-03 09:57:57 +01:00
Mészáros Mihály
267f7a28db Merge branch 'master' into fixes 2018-10-31 11:05:25 +01:00
Mészáros Mihály
1796233e66 Fix: unecessrey if (thx damencho) 2018-09-14 09:55:28 +02:00
Mészáros Mihály
23cfaa1253 add --web-admin-listen-on-workers 2018-09-12 10:30:09 +02:00
Thibaut Ackermann
b2fcc81a0d Move web-admin to dedicated (configurable) ip:port 2018-09-12 10:30:09 +02:00
Mészáros Mihály
025dc300ce Revert "Enhancement: Add option to disable Web-Management-Interface"
This reverts commit c48835e230.
2018-09-12 10:30:09 +02:00
Mészáros Mihály
8a60754d70 Change loopback defaults 2018-09-12 10:30:07 +02:00
Mészáros Mihály
db02736534 realm sanity check 2018-09-12 10:29:30 +02:00
Mészáros Mihály
bb821cee2e refactor is_secure_username 2018-09-12 10:29:30 +02:00
Mészáros Mihály
93c1103bb8 Add new feature: keep-address-family 2018-09-06 14:26:42 +02:00
Mészáros Mihály
9895339b23 --prod pointer bug fix 2018-09-04 08:02:42 +02:00
Mészáros Mihály
a3b8cd59d1 add Falls Through comment hint to compiler to avoid warning 2018-08-02 12:32:13 +02:00
Mészáros Mihály
e8ec72caba Revert "add hint fallthrough to compiler to avoid warning"
This reverts commit 5772435c73.
2018-08-02 12:12:14 +02:00
Mészáros Mihály
5772435c73 add hint fallthrough to compiler to avoid warning 2018-08-01 15:45:24 +02:00
Mészáros Mihály
ab07d244b4 fix get_family 2018-07-24 15:04:08 +02:00
damencho
4133ad8d54 Fixes leaking udp6 sockets.
Guess address family from client socket address when STUN_ATTRIBUTE_REQUESTED_ADDRESS_FAMILY is missing.
2018-07-24 14:47:54 +02:00