Move the MinGW #if tests to after where mswsock.h is included.
Tidy up documentation.
Tested against MSYS2 UCRT64, CLANG64, MINGW32 and MINGW64 on Windows 11.
Fixed a couple of minor build issues found.
Host names larger than 255 bytes will cause an internal buffer overflow.
Hostnames provided to coap_resolve_address_info() now have their length validated.
Discovered by SecMate (https://secmate.dev).
Sanity check host lengths when parsing a CoAP URI when using the coap_split_uri()
function.
With a large boolean parameter value, (longer than "false"), memory
would be read past the "true" or "false" string boundaries in the ".rodata"
section when doing a memcmp(), potetially causing the application to crash
when calling coap_new_oscore_conf() with a specially crafted configuration
file.
It also can provide a mechanism to determine the byte values following the
"true" or "false" string boundaries which could lead to accessing sensitive
information. The standard libcoap library does not have defined keys or
certificates. This can only be done by a specially crafted local application.
Discovered by SecMate (https://secmate.dev).
Now fixed.
MbedTLS based PKI clients may report
SSL - Attempt to verify a certificate without an expected hostname.
This is usually insecure. In TLS clients, when a client authenticates a
server through its certificate, the client normally checks three things: ....
The application provided client_sni may have been removed as per
https://datatracker.ietf.org/doc/html/rfc6066#section-3
Literal IPv4 and IPv6 addresses are not permitted in "HostName".
and so MbedTLS is now explicitly told that therw is no hostname.
For embedded applications that can call the 'main()' function multiple
times, they need to have any statically (globally) defined variables
reset to their default values.
Server enabled for mcast receipt. When the server is acting as a proxy
sends a mcast packet out over a slave client type socket, it receives
the mcast packet on the server socket (which could then be forward out
of the client socket....).
This change prevents the server socket from passing up the libcoap stack
a mcast packet that it knows the client socket is sending.
./autogen.sh and ./configure no longer need to be run prior to running
make for Contiki, LwIP or RIOT from the appropriate examples sub-directory.
scripts/fix_version.sh now handles updating coap.h for the different
LIBCOAP_ and PACKAGE_ definitions.
Group together and document the run-time checks available for checking
the libcoap built-in functionality based on the ./cconfigure and / or
CMakeLists.txt options.
Create include/coap3/coap_defines.h file that contains a list of
COAP_ #defines created from the options defined when running ./configure
or cmake.
Add additional coap_*_is_supported() functions.
Tidy up the general proxy logic by moving common functionality
into libcoap.
New functions coap_proxy_forward_request(), coap_proxy_forward_response()
and coap_proxy_is_supported() added.
New --enable-proxy-code support added to configure.
New ENABLE_PROXY_CODE support added to CMakeLists.txt.
Support for common shared connection to next hop.
Support for round-robin balancing across multiple next hops.
Only support changing the client's source port if the DTLS library
has support / configured for CID.
Used when debugging server handling source address changes and CID
is in use.
Add in support for TinyDTLS (Client only) if TinyDTLS is patched
appropriately (not currently available on TinyDTLS main branch).
Add in new function coap_dtls_cid_is_supported().
'make distclean' removes header files built from the .in files, which
means that they are not available for different OS builds.
The same is true for CMakeLists.txt.
Remove the need for the .in files and update for libcoap revisions
by using a new script scripts/fix_version.sh created from
scripts/fix_version.sh.in.
CI has been updated to check revisions have been updated in the
appropriate places.
Do not remove libcoap-3.sym and libcoap-3.map when doing 'make distclean'
as they are git tracked files.