Two cases for not updating active sockets[] with file descriptors from a
session (non epoll code)
coap_retransmit() can release a session
coap_dtls_handle_timeout() can disconnect a session
Move the restransmit test code to before any updates to socket[].
Update coap_dtls_handle_timeout() to return a value indicating a DTLS timeout
has occurred. At the same time move the coap_dtls_handle_timeout() checks
into the first sessions iteration loop, removing having to iterate through the
sessions twice if DTLS.
Track the RCV mtu size separately from the XMT mtu, so that sufficiently
large PDUs can be built for receiving incoming data.
Wait until reliable session is complete and the initial CSM have been exchanged
before building any new PDUs for transmission so that they can hold the
appropriate amount of Max-Message-Size data.
Add in support into coap-server and coap-client for defining the
Max-Message-Size to use by adding in 2 new functions
coap_context_set_csm_max_message_size() and
coap_context_get_csm_max_message_size().
Add in flexibility into coap-server to control the initial example_data size.
Requires #844 to prevent recursive mutex locking when initiating proxy ongoing
session to upstream server.
Move around some of the COAP_CONSTRAINED_STACK mutex locking to prevent
recursive locking (issue when a proxy initiates an ongoing reliable client
connection).
This commit adds two new events (`COAP_EVENT_SERVER_SESSION_NEW`
and `COAP_EVENT_SERVER_SESSION_DEL`), which are triggered when the
IO loop creates or deletes server-side sessions.
This commit allows using a system-provided version of TinyDTLS when
building libcoap.
To do so, some potentially backwards-incompatible changes to the way
TinyDTLS is handled in the configure-script were made:
- The argument `--with-submodule-tinydtls` is added. If it is set to
yes, the configure-script will use the TinyDTLS git submodule for
DTLS functionality (assuming `--with-tinydtls` is also set).
- The configure-script will prefer using the system-provided version
of TinyDTLS as long as `--with-submodule-tinydtls` is not explicitly
set to yes.
- It will however fall back to the vendored version by default if no
system-provided version could be found and if
`--without-submodule-tinydtls` is not explicitly set.
- If a system-provided version of TinyDTLS was found, it will be used
automatically if no DTLS backend was selected explicitly (with the
lowest priority compared to the other DTLS libraries). However,
the submodule will *never* be used automatically, even if
`--with-submodule-tinydtls` is set (i.e., to use the submodule,
`--with-tinydtls` must be set as well).
If TinyDTLS is not installed system-wide (or if the installed version
is too old to contain a pkg-config file), the behaviour should be
identical to older versions.
Otherwise, use the `--with-submodule-tinydtls` option to force usage
of the git submodule version if required.
Add in new function coap_async_trigger() to immediately release an async
session, rather than using coap_async_set_delay(async, 1).
Add new internal function coap_update_epoll_timer() to reduce code
duplication and use it for the async logic.
Move doing coap_io_prepare_epoll() for every epoll event to just doing it once
outside of the loop.
Update documentation.
This then allows any (D)TLS to be set up between sending off the requests and
better demonstrates how this can be done in user code.
Allocate separate data for each post/put PDU.
Hold off on starting timer for next transmission until after response has
been received from the server (handles relatively slow DTLS startup).
RFC 9200 defines the new media type application/ace+cbor for
Authentication and Authorization in Constrained Environments. The
CoAP Content-Format value for this media type is registered as value
19.
Support self-signed certificates that have expired.
Correct variable ret initialization in coap_tls_read().
Catch some additional MbedTLS SSL error codes in do_mbedtls_handshake().
- For targets having their own hardware entropy/RNG implementation
using mbedtls_hardware_poll()
- This change was made as since mbedtls-3.x, passing a RNG function
to all functions that accept a f_rng parameter is mandatory
Commit 9cb2f62a3 [1] has introduced library-internal handling of
Block1 and Block2 requests. To add the data to the response body the
function coap_add_data_large_internal() is used.
This change calls the function independent of a Block2 request unless
request is NULL. The response code is set to 500 if
coap_add_data_large_internal() failed.
Fixes Coverity-Id 1514379
[1] https://github.com/obgm/libcoap/commit/9cb2f62a3eef2e0aeb682615b785d4734b473bd4
After autogen.sh --clean, all auto-generated files need to be
re-created. Before this has happened, autoreconf complains
with
configure.ac: error: required file 'ar-lib' not found
and signals an error on exit.
This change fixes the issue by touching ar-lib to force creation of an
empty file if it does not exist. Because autoreconf is called with the
options --force --install, this file will get replaced afterwards.
The CoAP Proxy may not know how to handle a Critical option, but if it
is safe to forward it should be able to handle this.
RFRC7252 5.4.1
Critical/elective rules apply to non-proxying endpoints. A proxy
processes options based on Unsafe/Safe-to-Forward classes as defined
in Section 5.7.
If this is an incoming proxy type request special case any
critical options that are safe to forward.
Track ongoing sessions from an enabled proxy server so unknown critical
response options can be passed back to the originating requestor.
Update coap-server to handle Proxy-Scheme for proxying.
Update tests to use critical option 25 instead of 9.
The provided host for windows-latest is migrating across from
windows-2019 to windows-2022 on github. This allows things to be built on
a windows-2022 system.
Fix off-by-one error for option delta = 269.
Correct / clarify the tests in coap_insert_option() when working out extended
option delta for inserting new option.
When coap_pdu_parse() returns 0, the contents of pdu are undefined and
must not be processed. This change proceeds fuzzer tests only if parsing
succeeded.
Fixes OSS-Fuzz issue 44503 [1]
[1] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44503