Commit Graph

59 Commits

Author SHA1 Message Date
Michael Jones
0af0fc3ec2
Address various minor clang-tidy warnings (#1513)
No specific methodology other than checking the github CI output for the
`clang-tidy` job, and fixing things one at a time.
2025-05-29 19:12:50 -07:00
Pavel Punsky
20da9cd09a
Cleanup ALPN_SUPPORTED define usage (#1616)
As of openssl 1.1.1 ALPN is supported - no need for all the ifdefs anymore
2024-12-19 16:41:45 -08:00
Michael Jones
b523616b1f
Use bool, instead of int, for the functions in ns_turn_msg.c (#1553)
And address knockon effects in other files, e.g. adjust if-statements
and other function parameters and return types.
2024-08-23 17:49:14 -07:00
Michael Jones
d1db5e590d
Include what you use (#1512)
Use the include-what-you-use program to (partially) clean up header
includes, so that only includes which are needed, and no includes that
are not needed (or at least closer to that ideal) are done.

For a c-language project, the build-time improvements from this change
is minimal. This would have a much bigger impact on a C++ project than a
C-project for build times.

So for coturn, this change is mostly intended to just provide
consistency and make it easier to locate weird issues like strange
dependencies, and unnecessary connections between code.
2024-06-01 18:13:08 -07:00
Michael Jones
ad94684b23
Use bool over int for the turnutils_uclient program (#1420)
Converts all of the variables in the uclient program that should be bool
but weren't.

A few other minor adjustments made at the behest of clang-tidy, but this
change does not address all of clang-tidy's complaints.
2024-05-29 20:39:51 -07:00
Michael Jones
544382f313
Fix mingw and MSVC ci build (#1491) 2024-05-27 13:43:40 -07:00
Michael Jones
da332ed9e7
Add the InsertBraces command for clang-format to ensure that all conditionals always have braces (#1408)
- Why? Because code where conditionals lack braces is much harder to read, and prone to indentation confusion.
- How? Just added an extra flag to .clang-format and re-ran clang-format on all the files.

I also moved .clang-format up to the top level of the repo so that it can be applied to the fuzz targets as well.
2024-01-27 16:38:40 -08:00
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
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
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
d992d0c049
Fix resource leaks (#1048) 2022-10-27 14:07:21 -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
4ce784a878
Improve openssl3 and FIPS support (#955)
openssl-3.0 deprecated some APIs and introduced new APIs instead:

`SSL_get_peer_certificate ` -> `SSL_get1_peer_certificate `
`FIPS_mode()`->`EVP_default_properties_is_fips_enabled()`
`EVP_MD_CTX_set_flags()`->`EVP_default_properties_enable_fips()`
specifically for enabling FIPS mode

This change should workaround that by ifdef-ing old/new versions of
openssl and APIs - so pre-3.0 use existing APIs (so not change there)
and >=3.0 will use new APIs (whether it actually works or not is still
TBD as this is just a first step in openssl-3.0 support)

Should fix #886

Test Plan:
Run CI build that supports ubuntu-20.04 (openssl-1.1.1) and ubuntu-22.04
(openssl-3.0.2)
Both builds pass
None of them have FIPS support (which for 1.1.x stays the same as
before)

Co-authored-by: Pavel Punsky <pavel.punsky@epicgames.com>
2022-09-16 09:46:45 +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
e781060a52 Remove SSL_NEW() and SSL_FREE()
Do not overload functions from OpenSSL.
2019-03-07 08:00:09 +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
Oleg Moskalenko
a2c17748af cleaning 2016-08-27 20:18:42 -07:00
mom040267
4424b3c92a --sha256, --sha384, --sha512 parameters retired. 2015-04-11 07:26:55 +00:00
mom040267
9483dec4de turn-bis new release adjustments (dual allocation) 2015-04-10 07:07:18 +00:00
mom040267
8662de6d73 sctp fixes 2015-04-02 05:32:46 +00:00
mom040267
0496635edd fixing SCTP on Linux 2015-03-15 21:08:31 +00:00
mom040267
69653ea259 native SCTP support 2015-03-15 19:48:30 +00:00
mom040267
1b279a2a5f optional SCTP support added 2015-03-15 06:10:49 +00:00
mom040267
caf63a35de sha384 added 2015-02-06 08:17:49 +00:00
mom040267
08f0488255 sha512 added 2015-02-05 07:39:07 +00:00
mom040267
2e0b8aefcc TOS fixed 2015-02-04 06:14:11 +00:00
mom040267
e8b18b4586 REFRESH adjusted for the new SSODA specs 2015-02-01 08:59:30 +00:00
mom040267
d5b84163b6 working on even-port. 2015-02-01 07:26:29 +00:00
mom040267
3c40c14f40 working on new dual-allocation implementation 2015-01-31 23:25:45 +00:00
mom040267
237b3baaa7 short-term credentials removed in the TURN server 2015-01-11 06:28:58 +00:00
mom040267
a0ddb85245 ALPN fixes 2014-12-15 02:49:37 +00:00
mom040267
94c3c57456 DTLS code cleaning 2014-12-12 10:23:18 +00:00
mom040267
65dc483208 tls code cleaning 2014-12-11 08:19:29 +00:00
mom040267
06389df97c ALPN support added 2014-12-10 09:01:15 +00:00
mom040267
786105a9b4 DTLS v1.2 supported. 2014-12-09 09:29:27 +00:00
mom040267
380cc7580f working on TLS uclient 2014-11-11 07:21:47 +00:00
mom040267
0e208b06eb working on uclient TLS 2014-11-11 07:01:14 +00:00
mom040267
61947e8dbd Re-transmission implemented in the uclient. 2014-11-09 09:22:24 +00:00
mom040267
8f169e62bf working on uclient 2014-11-09 08:10:39 +00:00
mom040267
5ebdc93adc client fixes 2014-11-07 07:47:30 +00:00
mom040267
202b9d6841 debug addition 2014-11-03 09:02:29 +00:00
mom040267
7973a31f01 more debug information 2014-10-15 06:44:53 +00:00
mom040267
4235013950 TCP/TLS tests 2014-10-14 07:27:00 +00:00
mom040267
2425078425 log fixes 2014-10-11 18:18:23 +00:00
mom040267
cbb37c645f token timeout implemented 2014-09-28 08:38:15 +00:00
mom040267
a4c4721595 dialog done 2014-09-26 23:51:40 +00:00
mom040267
6aa1af102c working on oauth 2014-09-26 06:51:04 +00:00