These test scripts all contain a `finally:` block that attempts to print
proto_ver which does not exist:
```
print("proto_ver=%d" % (proto_ver))
```
This mistake appears to be a copy-and-paste error in commit b2a9daf ("02
broker subpub tests with v5 support") and went unnoticed because the
code is only reached if the tests fail.
Fixes: b2a9daf1 ("02 broker subpub tests with v5 support")
Closes: https://github.com/eclipse-mosquitto/mosquitto/issues/3123
Recent CMake changes caused CMake builds with the WITH_TLS option set to OFF to fail. The OpenSSL package is only found (find_package()) if WITH_TLS is ON, but linking to OpenSSL for the broker and library is not guarded by WITH_TLS. The build therefore fails.
Guard linking to OpenSSL, only linking if WITH_TLS is set.
Since generated keys have expiration date,
it means that the tests are not reproductible over time.
Integrator may be tempted to not rely on upstream files
and generate them on the fly at built time.
If need files are present this rule will be skip.
This change was motivated for maintenance of 2.0.11
in Debian 12 (stable).
I noticed that upstream regerated certs in master branch since,
but still they will expire in future.
Origin: https://github.com/eclipse-mosquitto/mosquitto/pull/3234
Relate-to: https://salsa.debian.org/debian-iot-team/mosquitto/-/merge_requests/21
Signed-off-by: Philippe Coval <rzr@users.sf.net>
The JSON string produced by cJSON_Print() is allocated with cJSON_malloc()
and must be freed with cJSON_free(), not mosquitto_free(). Using the wrong
allocator caused Mosquitto’s memory-tracking counter to underflow, leading
to spurious "out of memory" errors on subsequent allocations which
render the broker unusable.
This change replaces mosquitto_free(json_str) with cJSON_free(json_str)
in dynsec__config_save(), ensuring correct matching of allocators and
eliminating the underflow bug.
Signed-off-by: Jesús Fernández Manzano <jesus.fernandez@titanos.tv>
This only occurs in the very limited circumstance if
per_listener_settings is set true and the bridge is carrying out topic
remapping.
Closes#3261. Thanks to Brodie Griggs.