Commit Graph

102 Commits

Author SHA1 Message Date
Emil Ljungdahl
9fa8af6163
Use inline functions for errno checks (#1123)
Since winsock do not use errno, and have different error codes, this is
needed to be windows compatible

This pull request is a split of PR #1061
2022-12-22 11:10:34 -08:00
Pavel Punsky
eff1f9a09a
Set string bytes to null to prevent random origin (#1114)
Fix #1111
2022-12-06 17:04:57 -08:00
Pavel Punsky
5d44f5087b
Reduce code duplication when printing userdb (#1103)
TURN_USERDB_TYPE enum does not need to be "dynamic" based on what
libraries actually available during the build - all potentially
supported DB options are now enumerated.
Printing (to log or http) the DB type name is done with much less code
(using a helper function `userdb_type_to_string`)
2022-12-04 10:49:05 -08:00
Pavel Punsky
95373d3e2a
Cleanup logs on turnserver start (#1088)
Reformatting and removing some duplications:
- Some lines have WARNING WARNING: cleaned up.
- Lines printed using perror: only LOG_ mechanism should be used.
- Printing IO mechanism (epoll for example) for each thread: selected
mechanism logged once
- Duplicate lines (perror and also LOG): duplication removed
- Duplicates: clean up (because calling function multiple times -
configuration load)
2022-11-14 17:45:20 -08:00
Gustavo Garcia
d9108a4b54
Add clang format rules and checks (#935)
I would like to get feedback on this and see if people is confortable
with these clang rules.

Right now is using the "llvm" style increasing the line length from 80
to 120 given that coturn is using long lines often.

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2022-11-06 22:05:17 +01:00
Pavel Punsky
2716ed035a
Simplify defines for macOS platform (#1058)
`__APPLE__` is enough to detect macOS
2022-10-29 20:16:07 -07:00
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
1148ed7d0d
Add missing comma (#1041) 2022-10-24 22:35:38 +02:00
Pavel Punsky
af9bc12055
Sanitize DB connection string before printing to log (#1020)
Store sanitized version of DB connection string with password masked
(replace all chars with * which exposes its length)
Use sanitized version when logging connection string

Fixes #1017 and #272
2022-10-17 08:44:30 +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
Pavel Punsky
a3d338e2c1
Silence warnings by converting STRCPY to strncpy calls (#995)
STRCPY macro makes pointer comparison which creates a warning

In those places, replace the macro with `strncpy` with careful review of
destination buffer size

With this change I do not get compiler warnings at all
2022-09-30 08:17:46 -07: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
Pavel Punsky
a09aa989b6
Do not write outside of a buffer in admin interface (#972)
Writing outside of a buffer can only happen if incoming HTTP request is longer than UDP_STUN_BUFFER_SIZE (16KB).

This change validates that the request is no longer than the buffer size and drops it if it is the case

Fixes #342

Test plan:
- Run in debugger and send a 16KB request using curl - response returns, logs correct
- Send 16KB + 1b request - warning logged and request dropped

Co-authored-by: Pavel Punsky <pavel.punsky@epicgames.com>
2022-09-05 12:07:07 -07: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
Thibaut Ackermann
cf938cd915 fix the webadmin ip permission add/delete sql injection 2019-05-07 11:23:29 +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
7663167dff Remove pointer debugging machinery
There are tools and debugging options that can be used instead. Do not
reinvent the wheel with our own pointer tracking/debugging code.
2019-03-07 08:39:20 +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
043b102e38 Remove turn_strdup()
Do not overload strdup() from string.h
2019-03-07 08:00:08 +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
2d59a5de2b readd pwd check
regression from 4.5.1.0
2019-01-29 13:13:13 +01:00
Mészáros Mihály
fc5a5452f9
Merge pull request #330 from gribunin/master
Fixed missed \r\n symbols in HTTP headers from HTTPS management UI
2019-01-29 11:00:47 +01:00
Kirill Gribunin
5d54bd5335 Fixed missed \r\n symbols in HTTP headers from HTTPS management interface when no admin users defined 2019-01-18 19:18:34 +03: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
eb9b9c49be Add username sanity check, to avoid sql-injection 2018-11-07 10:47:24 +01:00
Thibaut Ackermann
8c7dbcdda0 fix memory leak in web_admin_input_handler 2018-10-31 10:36:26 +01:00
Mészáros Mihály
5d6f4fa920 Disable web-admin by default 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
Nicolas Edet
fa59c5f5d1 ensure all sessions are printed in webadmin 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
65d65937d0 Add +2 to not truncate string and avoid warning 2018-08-01 15:44:00 +02:00
Carsten Bock
c48835e230 Enhancement: Add option to disable Web-Management-Interface 2017-04-10 14:49:55 +02:00
yohan
e241d0c71f Add "--prod" to turnserver command-line options. It will hide turnserver version (like apache does).
This is a common corporate security requirement.
2016-10-27 17:48:32 +02:00
Oleg Moskalenko
88bd6268d8 iupdate https response on invalid http request 2016-02-27 22:29:17 -08:00
Oleg Moskalenko
51ca693359 SSLv3 support removed 2015-11-15 14:58:45 -08:00
Oleg Moskalenko
8ed6f9bd67 web interface adjusted 2015-09-15 22:42:39 -07:00
Oleg Moskalenko
dbc9dee42b working on multi-tenant server based upon oauth 2015-09-14 00:16:13 -07:00
mom040267
014177f274 compilation warning fixed 2015-05-05 06:52:59 +00:00
mom040267
be736f9f60 working on oauth 2015-04-22 05:59:31 +00:00
mom040267
ef552b16f4 working on oauth 2015-04-19 09:25:45 +00:00
mom040267
31b25414b4 working on oauth 2015-04-19 08:14:29 +00:00
mom040267
6dbee00b74 working on new third-party auth draft 2015-04-19 07:37:12 +00:00
mom040267
86f40b4bd9 working on third-party auth 2015-04-19 06:18:28 +00:00
mom040267
4424b3c92a --sha256, --sha384, --sha512 parameters retired. 2015-04-11 07:26:55 +00:00
mom040267
8662de6d73 sctp fixes 2015-04-02 05:32:46 +00:00
mom040267
c92e4e7480 encrypted admin user passwords 2015-03-21 07:29:00 +00:00