Gives the ability to add in additional library build checks through
the use of #define etc. that is not available to applications or
other host o/s support.
Preparatory work for further locking checks.
The change to cmake_coap_config.h.in solves the
following issue: when building with cmake the
functions at coap_notls.c were being compiled.
Apply fix to CMakeLists.txt.in for wolfSSL DTLS backend
Update libcoap functions that need to be called locked with a name
suffix of _locked.
Move matching functions out of coap_threadsafe.c to be coded just ahead
of the newly renamed _locked function.
Properly define the _locked function in the appropriate _internal.h file
for documentation, removing the #defines from coap_threadsafe_internal.h.
Work in progress for all the functions.
Remove coap_lock_* requirements for testdriver (coap_delete_node()).
As per https://datatracker.ietf.org/doc/html/rfc7252#section-3
Implementations of this specification MUST set this field to 1
(01 binary). Other values are reserved for future versions. Messages
with unknown version numbers MUST be silently ignored.
Two new functions added
coap_tls_engine_configure()
coap_tls_engine_remove()
Added in new PKI key type coap_pki_key_define_t which allows the CA, Public Cert
and Private Key to be different types (e.g. PEM, DER etc.).
Added a new key type ENGINE to make use of the configured tls_engine.
Added in a -q option to coap-server and coap-client for testing ENGINE.
Note: ENGINE is only supported by OpenSSL.
Add in new COAP_BLOCK_NOT_RANDOM_BLOCK1 option for
coap_context_set_block_mode(). This disables receipt of any Block1
packet (but not Q-BLock1) if the block numbers are not sequentially
received starting with 0. A 4.08 code is returned for every packet
out of order and its data is ignored.
If COAP_BLOCK_SINGLE_BODY is set in coap_context_set_block_mode(),
but not COAP_BLOCK_NOT_RANDOM_BLOCK1, then all Block1 packets are
assembled in the correct order before passing the body up to the
application. The receive logic will timeout after MAX_TRANSMIT_WAIT
(93 seconds) if there are any missing blocks, or 10 seconds if the
last block is seen.
If COAP_BLOCK_SINGLE_BODY is not set in coap_context_set_block_mode(),
and not COAP_BLOCK_NOT_RANDOM_BLOCK1, then the random order packets
are passed up to the application layer where it is the application's
responsibility to decide what to do with the randomly ordered packets,
and what response code to send.
This fixes a reported error in coap_update_token() where a size_t
calculation is overflowed (but all ends up with the correct value).
Instead of adding an overflowed size_t, now subtract the reversed
size_t calculation as appropriate.
coap_update_option() and coap_insert_option() similarily updated.
Create a CMakeLists.txt.in copy of CMakeLists.txt containing LIBCOAP_*
skeletons where appropriate. When ./configure is run, CMakeLists.txt then
gets updated with the latest versioning ready for distribution and using.
CMake unfortunately does not handle, for example, 4.3.5rc1 (the rc1 suffix)
for the "project (libcoap VERSION xxx)", so this has to end up as 4.3.5
in CMakeLists.txt.
For the test suite, treat these tests as using the public API so locking
is handled by the underlying libcoap.
The only exception is for coap_delete_node() which is an internal function
and expects context to be locked on entry.