Commit Graph
1029 Commits
Author SHA1 Message Date
Olaf Bergmann 8423ebbe8b client.c: allow empty user names
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.
2017-08-02 21:17:07 +02:00
Olaf Bergmann a061428eb6 coap_openssl.c: fix compiler warning for coap_dtls_new_context() 2017-08-02 21:14:06 +02:00
Olaf Bergmann 7dfeb91978 coap.h.in: avoid C++ name mangling for functions in libcoap.h
To avoid function names being mangled when compiling with C++,
the inclusion of libcoap.h has been moved into the extern "C"
declaration for coap.h.
2017-08-02 21:11:17 +02:00
Olaf Bergmann 44f392d29a client.c: added new method names from RFC 8132
Updated the method names for coap-client option '-m' to include
FETCH, PATCH, IPATCH (see [1]).

[1] https://tools.ietf.org/html/rfc8132
2017-07-18 11:43:23 +02:00
Olaf Bergmann 4e7f909037 Makefile.am: added missing files, fixed ordering 2017-07-11 17:03:04 +02:00
Olaf Bergmann df62452cca libcoap-1.{map,sym}: updated symbol table
The recent API change has triggered the update-map-file target.
2017-07-11 13:01:25 +02:00
Olaf Bergmann ef778403a6 Makefile.am: added missing files to EXTRA_DIST 2017-07-11 13:00:50 +02:00
Olaf Bergmann 036842f669 COPYING: updated text
The old text referred to LICENSE.BSD which has been extended and
renamed to LICENSE. The new text now reflects this update.
2017-07-11 12:59:09 +02:00
Olaf Bergmann b524316c19 libcoap-1.pc.in: Add DTLS-specific flags 2017-07-10 18:14:12 +02:00
obgm 96e536006f Merge pull request #99 from Trilliant/feature/fixHandlersForNewVerbs
resource.h: increase method_handler structure to hold new methods (FETCH, PATCH, IPATCH)
2017-07-10 17:25:07 +02:00
Olaf Bergmann 81c0dec8dd ChangeLog: updated changelog 2017-07-10 16:37:21 +02:00
Olaf Bergmann 684c27ea13 README.md, LICENSE: Updated licensing information
* Add license information for getopt.c (required for the Windows port, only).
* Add license information for GnuTLS, OpenSSL, tinyDTLS
2017-07-10 16:35:49 +02:00
Olaf Bergmann 9b76de1a3c configure.ac: Add tinydtls configuration option
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.
2017-07-10 15:35:45 +02:00
Olaf Bergmann 5687681d71 {tests/examples}/Makefile.am: add DTLS variables for static linkage
Statically linked executables require DTLS_CFLAGS and DTLS_LIBS.
2017-07-10 15:33:39 +02:00
Olaf Bergmann 4c38c6a7b2 test_{sendqueue,wellknown}.c: use new session-specific API
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.
2017-07-10 14:21:36 +02:00
Olaf Bergmann a070a8b3bc Merge remote-tracking branch 'tijuca/4upstream' into develop 2017-07-10 14:11:34 +02:00
Jean-Michel Julien 8abf63b867 resource.h: increase method_handler structure to hold new methods (FETCH,PATCH,IPATCH) 2017-07-06 15:11:10 -04:00
jcmichelou 87126f35c1 Add minimum timeout of 100ms for global DTLS timeout. Remove the peer from tinydtls retransmit list when the coap session is reset. 2017-07-01 17:09:14 +02:00
Carsten Schoenert 383a636cdd configure.ac: using more variables for binary versions
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.
2017-06-30 20:46:05 +02:00
Carsten Schoenert c8a97f91e2 configure.ac: fix up typos and indentation
No technical changes, only correction of typos and indentation oon some
parts.
2017-06-30 20:46:05 +02:00
Carsten Schoenert 7286a52474 DTLS support: export and use related flags to main Makefile
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.
2017-06-30 20:45:10 +02:00
Carsten Schoenert 9b2505772e configure.ac: adding info output about DTLS configuration
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.
2017-06-30 20:25:11 +02:00
Carsten Schoenert 4bbf6b8a08 configure.ac: adding logic and options for dtls support
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.
2017-06-30 20:24:50 +02:00
jcmichelou 1d2e985364 Fix missing pointer. 2017-06-30 19:26:55 +02:00
jcmichelou 42f68764f1 Safely separate the coap_address_t type from the tinydtls session_t type. 2017-06-30 19:15:00 +02:00
jcmichelou 699cf5d138 Fix handling of session events in tinydtls to call the handler only when it is safe to destroy the session object. 2017-06-30 15:08:40 +02:00
jcmichelou ab04f3924f Fix compilation warnings with gcc. 2017-06-29 19:20:39 +02:00
jcmichelou 7fb4ace2b7 Fix for the signedness warning with gcc.
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.
2017-06-29 18:12:46 +02:00
jcmichelou 4d4f3ba54f Fix compilation with gcc 2017-06-26 17:42:27 +02:00
jcmichelou b2fe4a64de Make MTU configurable.
Use static or stack storage for coap_packet_t.
2017-06-26 17:34:01 +02:00
jcmichelou 6e97dbafcf Add facility for the removal of all queued messages and observations of a session. Apply it to client-side destination unreachable notification. 2017-06-24 17:10:50 +02:00
jcmichelou 596b9a15a8 Use correct errno code for ICMP destination unreachable 2017-06-24 16:26:14 +02:00
jcmichelou ca597b6986 Fix typo in coap_tindydtls 2017-06-24 16:21:28 +02:00
jcmichelou b159565774 Add check for ioctl header file. 2017-06-24 16:20:18 +02:00
jcmichelou 07abf8643b Add support for catching destination unreachable messages. 2017-06-24 15:43:34 +02:00
Carsten Schoenert 4cef54f151 m4/ac_check_cryptolibs.m4: adding new m4 helper
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.
2017-06-24 09:33:48 +02:00
jcmichelou 5156e2b9a2 Handle all alert messages in OpenSSL. 2017-06-23 17:07:43 +02:00
jcmichelou d0974cacd5 A TLS fatal alert shall always disconnect the session. 2017-06-23 16:06:04 +02:00
jcmichelou 4d45219fe5 Add session expiration based on inactivity period and maximum number of idle sessions per endpoint.
Server sessions for which a close notify has been received are garbage collected immediately.
2017-06-22 19:13:20 +02:00
jcmichelou f6047c8e77 Fix gcc warning messages. 2017-06-22 16:13:38 +02:00
jcmichelou 0a0cd1fb4e Make retransmit timeout relative in tinydtls. 2017-06-22 16:06:11 +02:00
jcmichelou 9490a0c8ab Fix bug in setting the OpenSSL log level make its use consistent with tinydtls
Rename session.c and session.h to coap_session.c and coap_session.h
Use length to PSK hint and identity
Improve packet loss testing
2017-06-22 16:02:03 +02:00
jcmichelou 99925a1a97 Add init function for DTLS library.
Match dummy functions in coap_notls.c with their prototypes.
2017-06-21 20:57:12 +02:00
jcmichelou adf1238eae Add DTLS retransmit and recovery.
Add lossy networks debug option in examples.
2017-06-21 20:40:15 +02:00
jcmichelou 2197585f66 Add missing coap_openssl.c file in Makefile.am 2017-06-21 16:21:59 +02:00
jcmichelou 2f24ee8cdd Call dtls_close when session is closed to send a notify alert to the remote peer. 2017-06-21 15:45:02 +02:00
jcmichelou ae13e5127b Compile with tinydtls and remove warning message with gcc. 2017-06-19 20:37:11 +02:00
jcmichelou b389a5f6aa Add skeleton support for tinydtls with new API. 2017-06-19 16:58:12 +02:00
jcmichelou 8353417afb Added session management with simpler DTLS lib API.
Added DTLS support with OpenSSL.
2017-06-18 20:09:47 +02:00
jcmichelou 5b1a8f67bf Implement coap_session_t concept for POSIX. 2017-06-15 18:42:42 +02:00