Commit Graph

85 Commits

Author SHA1 Message Date
Pavel Punsky
e87c42524a
Fix TLS1.3 support
Fix TLS1.3 support

`TLSv1_3_SUPPORTED` was not defined so TLS1.3 was not enabled properly
2022-09-28 20:28:09 -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
98d19fc441
Fix small issues reported by cppcheck (#967)
- Redundant checks for variable values
- Potential nullptr dereference
- Double check for the same variable

Run with:
```
cppcheck --inline-suppr --language=c --enable=warning,performance --force .
```

Co-authored-by: Pavel Punsky <pavel.punsky@epicgames.com>
2022-09-08 11:25:38 +02:00
Pavel Punsky
e2ff7caf9d
Fix long log line printing (#974)
`vsnprintf` will stop at the max buffer size as provided in its 2nd
argument

But the return value is `The number of characters that would have been
written if n had been sufficiently large` meaning it can be larger than
actual buffer size
`fwrite` will actually use the larger, incorrect number and dump
unrelated memory to log (and crash with high confidence)

Test:
- Query admin interface with super long path (>16KB) - crash
- With the fix - no crash with the same input, log line cut off

Co-authored-by: Pavel Punsky <pavel.punsky@epicgames.com>
2022-09-08 11:24:28 +02:00
Steffen Moser
b722c84b45 Allow compilation on Solaris 11.4 2022-08-22 11:22:59 +02:00
Jeremy Murphy
832f11331f Depend on OpenSSL::Crypto and OpenSSL::SSL
Maybe only one is strictly required, but the list of headers used in
ns_turn_openssl.h includes things from both.
2022-08-16 12:41:44 +10:00
KORAY VATANSEVER
2b91f0ad8b Function renamed for the consistency. Incomplete coding completed.
Tested for the empty and invalid values.  Parameter is ignored in those cases.
2022-08-09 13:06:45 +03:00
KORAY VATANSEVER
22af3ea567 Add syslog facility configuration 2021-07-07 15:56:30 +03:00
Mészáros Mihály
54ef051844 Disable stun backward compatibility 2021-06-05 22:10:31 +02:00
KangLin
9f6defdac4 CMake: add -Wno-deprecated-declarations 2021-03-29 07:22:12 -07:00
KangLin
73da474804 CMake: add runtime install 2021-03-28 20:19:15 -07:00
Mészáros Mihály
31c936d51d
Merge pull request #721 from KangLin/cmake
Add to support cmake
2021-03-23 09:31:59 +01:00
KangLin
677e5dc5d3 Add cmake 2021-02-26 09:02:50 +08:00
Mark Hills
9bcc898b05 Restore no_stdout_log behaviour
In commit 599a61ee this was removed, by accident it could seem.
2021-01-25 09:31:47 +00:00
Mészáros Mihály
00659f3948
Merge pull request #599 from cedk/libressl
Do not use FIPS and remove hardcode OPENSSL_VERSION_NUMBER with LibreSSL
2020-12-08 08:48:15 +01:00
Paul Wayper
ed88f1605a Neater ISO-8601 timestamp format string
Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-09-01 20:57:54 +10:00
Paul Wayper
f59e9f8ad4 Allow the log timestamp format to be set
This allows the timestamp format in log output to be set by a function.

Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-09-01 18:43:56 +10:00
Paul Wayper
5e87c44469 Merge turn_log_func_default and vrtpprintf
The function `turn_log_func_default` calls the function `vrtpprintf` to print to syslog
or the log file.  The latter does exactly the same string formatting as the former, so
here we merge the two functions into one to do the string formatting once.  This also
makes sure that the log line is consistent on all outputs.

Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-09-01 18:35:01 +10:00
Paul Wayper
16eeb53e07 Allow new log format to be turned on if required
This provides the 'use_new_timestamp_log_format' variable in `ns_turn_utils.h`.  By
default it is set to 0 and the old 'seconds since daemon was started' timestamp will
be emitted.  However, if it is set to 1 or any 'true' number the new date and time
timestamp format will be used instead.

This has also resulted in a small clean-up of some of the string length handling.

Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-08-31 22:34:54 +10:00
Paul Wayper
762ee23482 Fixing a few errors - C still coming back to me
Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-08-26 21:05:08 +10:00
Paul Wayper
599a61eea6 Print full date and time in logs
Signed-off-by: Paul Wayper <paulway@mabula.net>
2020-08-25 21:46:15 +10:00
Cédric Krier
5b6739a793 Do not use FIPS and remove hardcode OPENSSL_VERSION_NUMBER with LibreSSL
Fix #552
2020-07-19 10:48:44 +02:00
Mészáros Mihály
991a82e104
Merge branch 'master' into master 2020-04-28 09:47:20 +02:00
Mészáros Mihály
4722697645 Fix compiler warnings
* Changed type from int to size_t to avoid warning
  warning: comparison between signed and unsigned integer expressions
* Fixed string truncation warning
2020-03-03 15:26:01 +01:00
Bertold Van den Bergh
ace903fd07 Add support for loadbalanced TCP connections (haproxy protocol v2) 2020-02-13 01:56:43 +01:00
chanduthedev
25338fa1c0 added null check for second char 2019-11-11 15:01:14 +08:00
Mészáros Mihály
8c8af9ec85
Merge pull request #442 from chanduthedev/ssh-length
Updated incorrect string length check for 'ssh'
2019-10-22 13:17:32 +02:00
Robert Scheck
cfdb99dc72 Append only to log files rather to override them (fixes #416) 2019-10-22 11:40:26 +02:00
chanduthedev
9b0e53c18a
Updated incorrect string length check for 'ssh'
ssh length should be 3, but checking for 4. So updated memcmp method to 3 instead of 4.
2019-09-27 14:36:03 +08:00
islamoglus
82fbde71bd using SSL_get_version method for BoringSSL compatibility 2019-04-22 16:00:57 +03:00
Mészáros Mihály
8e4db32259 Fix free hiredis_libevent2.c 2019-03-11 11:35:09 +01: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
abab870070 Remove turn_calloc()
Do not overload calloc() from stdlib.h
2019-03-07 07:59:04 +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
Bradley T. Hughes
ed91d4bc17 Remove turn_free_simple
Do not overload free() from stdlib.h
2019-03-06 23:34:25 +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
bb821cee2e refactor is_secure_username 2018-09-12 10:29:30 +02:00
Oleg Moskalenko
6aa8b7685b code cleaning 2017-03-26 20:11:03 -07:00
Richard Garnier
5a24333eaa max lifetime parameters 2016-09-20 13:57:31 +09:00
Oleg Moskalenko
a2c17748af cleaning 2016-08-27 20:18:42 -07:00
Oleg Moskalenko
79aed7d8b7 libreSSL compatibility 2016-08-27 16:49:26 -07:00
Oleg Moskalenko
2ad38333ea cleaning 2016-08-20 20:41:09 -07:00
Oleg Moskalenko
eec7e0cac9 basic OpenSSL 1.1.0 support 2016-08-20 18:49:30 -07:00
Oleg Moskalenko
51ca693359 SSLv3 support removed 2015-11-15 14:58:45 -08:00