coap_session_t uses reference counting hence client sessions must be
released by coap_session_release() instead of directly calling
coap_session_free().
Valgrind reports Syscall param sendmsg(msg.msg_control) points to
uninitialised byte(s) due alignment padding in the CMSG macros
leaving uninitialized gaps in struct sent to the sendmsg system call.
This issue was reported including this patch on the libcoap-developers
mailing list [1].
[1] https://sourceforge.net/p/libcoap/mailman/message/36141279/
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
If a TCP connection connection fails, or a an ICMP Unreachable is received
for a UDP packet, then the file descriptor is not closed off. Eventually
all fails when no more file descriptors are allowed.
Update functions appropriately.
Move coap_new_client_session_pki() back into coap_session.h (its correct place)
Add in enum coap_asn1_privatekey_type_t
A simple structure for (D)TLS-specific unit tests has been added.
Currently, only general support and the version number as reported
by coap_get_tls_library_version() are checked.
As unit tests with IPv6 addresses keep failing on docker-based
travis CI, this changes reverts to IPv4 usage in following files:
test_wellknown.c
test_sendqueue.c
Update coap_context_set_psk() to return on failure. Add in call to
coap_dtls_context_set_psk() function
Add in new function coap_context_set_pki()
Update #includes for compilation
Update coap_new_client_session_psk() to clean up and return on error. Add in
call to coap_dtls_context_set_psk()
Add in new function coap_new_client_session_pki()
Additional check for a call of coap_new_client_session_*() in
coap_new_endpoint()
Remove PSK specifics from coap_dtls_new_context() and put into new
coap_dtls_context_set_psk().
Create a new coap_dtls_context_set_pki() for PKI.
Include checks that either of coap_dtls_context_set_psk() or
coap_dtls_context_set_pki() have been called before setting up a (D)TLS
session
Update #includes for compilation
If the application needs to see CoAP ping requests or CoAP TCP pong responses
then this update provides calling the configured handlers at the appropriate
points.
If the application needs to see CoAP ping requests or CoAP TCP pong responses
then there needs to be a handler that can be set up that is called
appropriately.
Add in coap_get_tls_library_version() for determining TLS build base + version
Do not allow a dynamic openssl library to be loaded and used at application
runtime that is less than OpenSSL version 1.1.0.
A new function coap_get_tls_library_version() that returns a pointer to a
coap_tls_version_t structure that contains both the TLS library type libcoap
was compiled against as well as the current TLS library version.