Commit Graph

2634 Commits

Author SHA1 Message Date
Roger A. Light
26ffe1300a Various Windows build fixes. 2020-12-02 19:49:14 +00:00
Nikolay Raspopov
71845d28ac
Fixed some VS2017 compilation error and warnings (#1916)
* Fixed some VS2017 compilation errors and warnings.

Signed-off-by: raspopov <raspopov@cherubicsoft.com>
2020-12-02 15:59:45 +00:00
Roger A. Light
2687d18214 macOS build fixes. 2020-12-02 15:50:33 +00:00
Roger A. Light
550c54701e Fix cmake build when cjson not available. 2020-12-02 15:50:33 +00:00
Pierre Hallot
8f0bdd5fd3 Find package libwebsockets if the option is ON.
Otherwise, if the package is not installed, configuration will work, but building will fail.

Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
2020-12-02 11:54:28 +00:00
Pierre Hallot
2afc5783a9 CMake: Move cJSON check out of the plugin check since it is required elsewhere
Some client/app code also optionally use cJSON, however it won't be found if plugins are disabled.

Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
2020-12-02 11:28:51 +00:00
Pierre Hallot
6293e13142 Fix CMake warning about cJSON name mismatch
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (CJSON) does
  not match the name of the calling package (cJSON).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindcJSON.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:125 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
2020-12-02 11:28:51 +00:00
Roger A. Light
828e7ae130 More conversion fixes. 2020-12-02 10:41:58 +00:00
Roger A. Light
42f09b8add Build fixes 2020-12-02 10:36:00 +00:00
Roger A. Light
d291effdcf Fix mosquitto_ctrl Makefile build yes/no based on deps. 2020-12-02 10:31:25 +00:00
Roger A. Light
df1802d8f1 Fix client state conversion warnings. 2020-12-02 10:26:22 +00:00
Roger A. Light
27967f8885 Prevent possible unitialised use. 2020-12-02 10:10:21 +00:00
Roger A. Light
9e6efd2f32 Stop listeners before removing clients to avoid use after free. 2020-12-02 09:41:12 +00:00
Roger A. Light
232a759320 Log client port on new connections.
Closes #1911. Thanks to twegener-embertec.
2020-12-01 22:38:59 +00:00
Roger A. Light
a7f044bcea Respect receive-maximum on bridges. 2020-12-01 21:38:56 +00:00
Roger A. Light
3731535298 Add SPDX license identifiers. 2020-12-01 20:46:56 +00:00
Roger A. Light
04c110183c Bridge support for MQTT v5 maximum-qos. 2020-12-01 18:15:29 +00:00
Roger A. Light
ca4b23486b Bridges now obey MQTT v5 server-keepalive. 2020-12-01 16:08:05 +00:00
Roger A. Light
e030ca45cd Fix connack error printing. 2020-12-01 15:57:37 +00:00
Roger A. Light
0c22f475ff Fix bridges incorrectly setting Wills to manage remote notifications.
This is for when `notifications_local_only` was set true.

Closes #1902. Thanks to marcinkowskip.
2020-12-01 14:33:13 +00:00
Roger A. Light
7d05f70fe1 Fix mosq_test.py to_string() on Python 3 2020-12-01 14:27:39 +00:00
Roger A. Light
b34dcd2a67 Final remove support for legacy libwebsockets
This means libwebsockets < 2.4.0.
2020-12-01 13:41:14 +00:00
Roger A. Light
730fc34539 Build fix for WITH_TLS=no. 2020-12-01 13:40:03 +00:00
Roger A. Light
c39a42adcc Report an error if the config file is set to a directory.
Closes #1814. Thanks to Odysseus1710.
2020-12-01 12:17:31 +00:00
Roger A. Light
29c771cdd4 Add lib and client support for OS CA certs
- Add `MOSQ_OPT_TLS_USE_OS_CERTS` option, to instruct the client to load and  trust OS provided CA certificates for use with TLS connections.
- All clients now load OS provided CA certificates if used with `-L
  mqtts://...`, or if port is set to 8883 and no other CA certificates are
  used. Closes #1824.
- Add the `--tls-use-os-certs` option to all clients.

Closes #1824. Thanks to Jens Reimann.
2020-12-01 11:51:13 +00:00
Roger A. Light
c2f62f03aa Set SSL_OP_SINGLE_DH_USE to protect against weak dhparam primes. 2020-12-01 10:55:00 +00:00
Roger A. Light
b7e6638fd8 Add ciphers_tls1.3 option, to allow setting TLS v1.3 ciphersuites.
Closes #1825. Thanks to Valentin Dimov.
2020-12-01 10:45:10 +00:00
Roger A. Light
ed28c416e9 Null checks in client tests. 2020-12-01 09:48:11 +00:00
Roger A. Light
6bd45f0092 dynsec: Better test coverage 2020-11-30 17:15:43 +00:00
Roger A. Light
aaf30dc622 dynsec: Fix incorrect test command. 2020-11-30 13:14:14 +00:00
Roger A. Light
0a7afd22c4 dynsec: Fix logging args. 2020-11-30 13:13:48 +00:00
Roger A. Light
757888b7f5 ctrl: Add warning if connecting without encryption. 2020-11-30 10:47:22 +00:00
Roger A. Light
692fa5537d dynsec: Reply with error on add role fail. 2020-11-30 10:32:09 +00:00
Roger A. Light
13bdd255a1 Fix incorrect array address on error. 2020-11-30 10:31:14 +00:00
Roger A. Light
0605fd402a dynsec: Command logging. 2020-11-30 10:10:12 +00:00
Roger A. Light
e5af6def25 dynsec: Simplify 2020-11-29 23:26:57 +00:00
Roger A. Light
d0d36b7c33 dynsec: Remove unused code 2020-11-29 23:17:39 +00:00
Roger A. Light
31e3fa4d07 dynsec: Invalid UTF-8 tests, plus some fixes. 2020-11-29 23:16:52 +00:00
Roger A. Light
c303c67461 dynsec: Return group not found on getGroup. 2020-11-28 00:34:53 +00:00
Roger A. Light
ad8cf9fc03 dynsec: Start of invalid role commands tests. 2020-11-28 00:34:33 +00:00
Roger A. Light
423e1a00d2 dynsec: Tests for group commands with invalid params, plus fixes. 2020-11-28 00:01:58 +00:00
Roger A. Light
a3258f7d82 Packet cleanup without locks
Prevents use of invalid mutexes during mosquitto_destroy.

Closes #1914. Thanks to Nikolay Raspopov.
2020-11-27 15:36:34 +00:00
Roger A. Light
7ccf4c44fd dynsec: Tests for invalid client command input. 2020-11-27 14:35:07 +00:00
Roger A. Light
6739152fda dynsec: Various minor fixes. 2020-11-27 14:34:46 +00:00
Roger A. Light
f6e17b81b9 dynsec: More modifyRole test coverage. 2020-11-26 17:24:39 +00:00
Roger A. Light
6cffd4264e dynsec: ACL tests. 2020-11-26 17:24:20 +00:00
Roger A. Light
598b1d7b00 dynsec: Fix free on modifyClient. 2020-11-26 15:11:20 +00:00
Roger A. Light
ba8e888e41 dynsec: Refactor some cJSON adding code to reduce redundancy 2020-11-26 14:49:28 +00:00
Roger A. Light
d8775b7d9c dynsec: Consistent behaviour when setting clientid. 2020-11-26 12:18:57 +00:00
Roger A. Light
047c09bd32 dynsec: Anon group tests 2020-11-26 12:18:20 +00:00