src/coap_openssl.c:
Remove NULL as a valid cipher from the cipher list.
Add in TLSv1.3 ciphers if OpenSSL 1.1.1 (they are already included in
TLSv1.2 definition, but this is to document this is happening).
Remove the TLSv1.0 deprecated ciphers.
Cipher strings can now be overridden during compilation by
using -DCOAP_OPENSSL_CIPHERS=xxx compiler option where xxx is the
cipher string as defined in
https://www.openssl.org/docs/man1.1.0/man1/ciphers.html
Explicit PSK cipher strings can now be overridden during compilation
by using -DCOAP_OPENSSL_PSK_CIPHERS=xxx compiler option where xxx is the
cipher string.
Log the client ciphers presented, and the cipher chosen.
include/coap2/coap_debug.h:
src/coap_debug.c:
Add in COAP_LOG_CIPHERS as a debug level (value 9) which matches getting the
cipher information reported in GnuTLS, and is now used for OpenSSL.
man/coap-client.txt.in:
man/coap-rd.txt.in:
man/coap-server.txt.in:
Include OpenSSL for verbosity > 7.
win32/coap-client/coap-client.vcxproj:
win32/coap-rd/coap-rd.vcxproj:
win32/coap-server/coap-server.vcxproj:
win32/install/install.vcxproj:
win32/libcoap.vcxproj:
win32/testdriver/testdriver.vcxproj:
Update WindowsTargetPlatformVersion to $(LatestTargetPlatformVersion)
and PlatformToolset to $(DefaultPlatformToolset).
Let configure enable (the default) or disable assert() code.
configure.ac:
Add in --enable-assert (the default) / --disable-assert support in libcoap.
Previously this was always enabled unless -DNDEBUG was passed in as a compiler
option. Now NDEBUG is set or unset as appropriate in coap_config.h
This does not affect how assert()s work within the examples etc., only in the
library.
TODO:
HAVE_ASSERT_H is now cleaned up, so remove entry.
include/coap2/coap_internal.h:
Include assert.h for the library.
include/coap2/coap_io.h:
include/coap2/net.h:
include/coap2/resource.h:
src/address.c:
src/block.c:
src/coap_debug.c:
src/encode.c:
src/mem.c:
src/option.c:
src/pdu.c:
src/subscribe.c:
src/uri.c:
Remove un-needed '#include <assert.h>'
Note: address.h and utlist.h still include assert.h as there are assert()
within the header files.
examples/client.c:
src/coap_io.c:
src/coap_session.c:
src/net.c:
src/pdu.c:
src/resource.c:
src/str.c:
Remove any '#ifndef NDEBUG' wrappers for coap_log() output as they were true
before, but may not be now.
OSS-Fuzz [1] is a decentralized fuzzing service for open-source
software projects. This badge shows the status of libcoap wrt to the
latest fuzzer runs.
[1] https://google.github.io/oss-fuzz/
Options such as COAP_OPTION_ETAG are up to 8 bytes in size. While
being opaque, they can internally be represented as an 8 byte number.
include/coap2/encode.h:
libcoap-2.map:
libcoap-2.sym:
src/encode.c:
Create 8 byte versions coap_decode_var_bytes8() and coap_encode_var_safe8().
It is possible to miss a packet retransmission if it is just about to happen
and the coap_run_once() logic takes the time past the packet retransmission.
The retransmission will take place when coap_run_once() is next run, but that
could be significantly later.
1) Create a new coap_io_prepare_epoll() function that calls coap_write(), but
sets the etimer within this function instead of at the end of coap_run_once().
2) Handle the etimer trigger within coap_io_do_events() rather than loop
checking coap_io_do_events() within coap_run_once().
include/coap2/net.h:
Define coap_io_prepare_epoll().
Update coap_io_do_events() to be type void.
src/coap_io.c:
Add in coap_io_prepare_epoll().
Update coap_run_once() to use new/updated functions.
src/net.c:
Update coap_io_do_events().
Make coap_new_context() always fail if there is an epoll logic setup failure
libcoap compiled for epoll will not continue to run.
Give a runtime warning if coap_read() or coap_io_do_events() are called when
libcoap is compiled or not compiled respectively for using epoll.
[Both coap_read() and coap_io_do_events() need to be in libcoap-2.{map|sym} to
support when compiling with or without epoll support]
libcoap-2.map:
libcoap-2.sym:
Make coap_io_prepare_epoll() application accessible.
* Passing EPOLL=no disables the epoll interface usage. Other values
default to yes, i.e. epoll is used if available.
* Passing SMALL_STACK=yes enables some values stored in static
variables instead pushing on the stack. This usually requires
mutex support in the operating system.
coap_config.h.windows:
Windows has struct cmsghdr so use it.
Update libcoap versions.
include/coap2/coap.h.windows:
Update libcoap versions.
Bring in line with build include/coap2/coap.h.
include/coap2/coap_session.h:
Include coap_forward_decls.h so things build correctly.
win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:
Add in missing include files.
On systems that support pthread mutexes, stack usage can be minimized
with the use of static variables. Concurrent access is protected
on these systems with mutexes. Platforms that do not have pthread
support must map the coap_mutex_* macros accordingly.
include/coap2/coap_dtls.h
include/coap2/coap_session.h
include/coap2/pdu.h
man/coap_encryption.txt.in
src/net.c
Revert out all the #define -> enum in #386 that require the enum to be
one byte long.
This is compiler version dependent when doing static inline expansions.
examples/client.c:
Make hex2char() just static.
examples/etsi_iot_01.c:
Make coap_add_payload() just static.
include/coap2/address.h:
src/address.c:
Make coap_address_init() an actual function.
libcoap-2.map:
libcoap-2.sym:
Expose coap_address_init() as a function.
Makefile.libcoap:
Include address.c as one of the libcoap files for Contiki.
examples/lwip/Makefile:
Include address.o as one of the libcoap files for LwIP.
It appears that MAC OX X (10.13.2) builds do not like the size of the sa to
be larger than the size of struct sockaddr_in when working with IP v4
addresses.
src/coap_io.c
Update the bind() calls to use the correct address size for IP v4.