Zero-length strings passed to -u are valid user names for DTLS.
The function cmdline_read_user() therefore returns 0 when the
argument passed with option '-u' is an empty string.
The new option '--with-tinydtls' allows selecting tinydtls as
DTLS implementation. This option must be combined with '--disable-shared'
as tinydtls supports only static linkage. Unlike GnuTLS and OpenSSL,
tinydtls is not enabled automatically during configuration.
Sendqueue nodes and send operations now require a session object.
This modification calls coap_new_client_session() on a global
coap_context_t object to create a fake session on the loopback
interface.
Adjusting version numbers in various places for dot and doxygen is
tedious and error prune. So set up the required versions right before
the code block for those checks.
To be able to use the collected CFLAGS and LIBS variables in the main
Makefile substitute DTLS_CFLAGS and DTLS_LIBS with the found values from
previous made checks and exporting them to autoconfigure.
Also define the found development crypto library into the configuration
header file 'coap_config.h.
We may need to add the flags also to examples/Makefiles.am too.
Giving some more information to the user than the output of the
configure with it's calls itself. By adding this output function the
user will see which library with which version etc will be used.
DTLS features are needing external cryptographic libraries for proper
working. There are some possibilities to use existing libraries of that
kind.
Based on discussions on the ML and also the issue tracker on GitHub we
found some consensus to use and support GnuTLS and OpenSSL at least in
the beginning of implementing DTLS support. The added code is using
GnuTLS 3.2.0 and OpenSSL 1.1.0 as required minimum versions.
This commit is adding a new configure option '--enable-dtls' which is
turned on by default to build libcoap by default with DTLS
functionality.
It's adding also two more additional options that let the user decide
which cryptographic library should be used for DTLS support. The two
optional options are '--with-gnutls' and '--with-openssl'.
These two options are optional and a user doesn't need to set any of
them if he doesn't care which library should be used. If these options
are not given the logic will first try to find the GnuTLS library for
usage and if not found do a fallback to OpenSSL.
The following behaviour is now implemented into configure by this commit:
$ ./configure --disable-dtls
or
$ ./configure --enable-dtls=no
Both options configuring the source to not implement any DTLS
support.
$ ./configure # without additionally options '--with-gnutls' or '--with-openssl'
The configure script is trying first to find GnuTLS for DTLS.
If the system hasn't GnuTLS development files the configure script is
moving over to OpenSSL and try to find the development files of
OpenSSL. If any files can't be found the script will break with a error
message.
$ ./configure --with-gnutls
The development files for GnuTLS will be explicit searched and used even
if also OpenSSL is available and usable.
$ ./configure --with-openssl
Like before but with the needing for OpenSSL development files. A
optional availability of GnuTLS on the host will be ignored.
Compact coap_address_t.
Use coap_queue_t for all queues.
OpenSSL warning for close alert should be info level.
Fix OpenSSL log level not working.
Use the application defined MTU in OpenSSL.
coap_log() optimization to avoid generating the log message text before testing the log level.
coap_can_exit() should check the new retransmit queues.
Fix retransmit time sometimes not correctly computed relative to sendqueue_basetime.
Add coap_write() API call for applications with their own main loop.
For adding further configure options about embedding DTLS support into
libcoap creating two new m4 functions AX_CHECK_GNUTLS_VERSION and
AX_CHECK_OPENSSL_VERSION.
The purpose of this new m4 functions is simply to check for the required
version of the combined library with a little bit of error handling.
As those checks are needed more than once later it's better to collect the
the logic and calls in dedicated m4 functions.