Fixes future Node.js 20 deprecation for github workflows.
There are still some other actions that continue to use Node.js 20 which will
need to be updated when they have also been ugraded to stop CI Action run warnings.
Analyzer run time does not like A -= B or A +=B even if A and B are uint32_t as there is potential
for overflow.
Analyzer run time does not like overflow when doing coap_tick_t - coap_tick_t.
Analyzer run time does not like (uint8_t << 24) as uint8_t is promoted as int, not u_int.
Analyzer run time does not like while(A--) {} even if A is uint32_t, as A is always decremented on
the test, even if the value of A is 0.
Fix potential overflow when analyzing an asn.1 tag.
Fix potential overflow when doing decode_segment() on a % hex value.
Include
-DCOAP_OPENSSL_PSK_SECURITY_LEVEL=0
as a compile time option to give a security level of 0 for PSK clients,
allowing them to connect to old servers that have not been TLS updated..
Vslues ore 0-5. The default (usually) is 1.
The function SSL_set_security_level() is called
with the defined level of COAP_OPENSSL_PSK_SECURITY_LEVEL.
Note: Setting this to 0 adds weak ciphers to the list of supported ciphers,
opening up potential security vulnerabilities.
Include common system header files in coap_internal.h based on HAVE_*H
definitions.
Remove these system header files from include/*/*.h.
Add in system header files where appropriate in various apps.
Add some improvements to make secure coap work on Zephyr 4.3.0
with mbedtls (not using Zephyr TLS protocol options).
We now set the build options to zephyr, so we make use of the
internal mbedtl in zephyr, so we do not require a specific header
file anymore.
In older versions of Zephyr, where mbedtls does not expose the
configuration, we can force-set the macro in the C flags, so that
mbedtls will have our required function.
This way, we do not need to change the mbedtls included in Zephyr,
while still supporting a few older versions.
Function coap_context_set_max_body_size() added.
For servers, if body size is too large, a 4.13 response is generated.
For clients, if the body size is too large, the server gets a RST and
no date is passed to the application. A new event COAP_EVENT_BLOCK_ISSUE
is generated.
This change adds in the compatibility with the mbedtls-4.0 release.
This release has deprecated the classic mbedtls crypto APIs in favour
of standardized PSA crypto APIs.
For more information please refer to:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-4.0.0
Add in new functions
coap_new_client_session3()
coap_new_client_session_pki3()
coap_new_client_session_psk3()
coap_new_client_session_oscore3()
coap_new_client_session_oscore_pki3()
coap_new_client_session_oscore_psk3()
which effectively does coap_session_set_app_data2() and
coap_ws_set_host_request() early on in the session set up cycle.
Make sure all application callbacks are called with a coap_lock_callback*()
wrapper.
Rename callback variables within the internal structures with a _cb suffix for
ease of review.