Commit Graph
1610 Commits
Author SHA1 Message Date
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
Pawel Winogrodzki d5f92bee71 net.c: correct brackets in if-statement
Making sure that "if" statements have opening brackets
on the same line to fit with the rest of the code.
2017-06-16 03:14:27 -07:00
jcmichelou 5b1a8f67bf Implement coap_session_t concept for POSIX. 2017-06-15 18:42:42 +02:00
jcmichelou b2ab881ad4 Fix the result of dtls branch merge so that all the examples work (DTLS support not enabled yet) 2017-06-13 14:38:30 +02:00
jcmichelou 1c79a4b977 Merge remote-tracking branch 'remotes/obgm/dtls' into dtls-dev with tinydtls support
# Conflicts:
#	Makefile.am
#	configure.ac
#	examples/client.c
#	examples/coap-rd.c
#	examples/coap-server.c
#	include/coap/address.h
#	include/coap/coap_io.h
#	include/coap/net.h
#	include/coap/prng.h
#	libcoap-1.map
#	libcoap-1.sym
#	src/net.c
#	src/platform/posix/coap_io.c
2017-06-12 17:26:25 +02:00
jcmichelou fdf3dabb0c Activate dual-stacked BSD socket logic on linux after validation. 2017-06-10 16:46:37 +02:00
jcmichelou 8d0223f21f Merge branch 'win32' of https://github.com/spinetix/libcoap into win32 2017-06-10 16:22:12 +02:00
jcmichelou 60dced7dfc Modify include path in visual studio project files to match changes in develop. 2017-06-10 16:20:13 +02:00
jcmichelou 78148d0c20 Merge develop into win32 2017-06-10 16:19:12 +02:00
Carsten Schoenert aafb87e50d configure.ac: fix broken ctags detection
While adding the freebsd platform into the supported build environments
the check for the needed ctags binary was modified
(aa7256a812), unfortunately the changes
made aren't correct and due this the target check_ctags in the toplevel
makefile was always assuming the correct ctags binary is around.

This was resulting in broken libcoap-1.{map,sym} files if 'make dist'
was called in case the user hasn't installed exuberant-ctags like ctags.
2017-06-06 15:38:36 +02:00
jcmichelou ae04e001aa Remove CUnit headers and prebuilt shared libraries. The testdriver project is no longer by default as part of the solution. 2017-06-03 16:07:29 +02:00
obgm cc49fbdc11 Merge pull request #88 from chanijjani/typo_fix
coap_io_lwip.c: fix typos in comments
2017-06-01 13:34:52 +02:00
Chanhee 69197feb15 coap_io_lwip.c: fix typos in comments
Few typos are fixed.
2017-06-01 19:58:35 +09:00
Olaf Bergmann bfca87cfb7 LICENSE: drop GPL as licensing options
From now on, the only licensing option for libcoap is BSD 2-Clause.
bsd-licensed
2017-06-01 12:51:20 +02:00
Olaf Bergmann 6d7ba61ae0 libcoap-1.pc: fix pkg-config include path
This change excludes the coap subdirectory from the include path
reported by pkg-config --cflags to avoid name conflicts with other
installed packages. Applications now must add the prefix 'coap/'
to include directives for libcoap header files, e.g.

  #include <coap/coap.h>

Jean-Claude Michelou has reported this problem in Bug #82 [1].

[1] https://github.com/obgm/libcoap/issues/82

A minimal Makefile now could look be written as:

  PKG_LIBCOAP=libcoap-1
  CPPFLAGS=$(shell pkg-config --cflags-only-I $(PKG_LIBCOAP)) -DWITH_POSIX
  LDFLAGS=$(shell pkg-config --libs-only-L $(PKG_LIBCOAP))
  LDLIBS=$(shell pkg-config --libs-only-l $(PKG_LIBCOAP))
2017-06-01 12:33:04 +02:00
Olaf Bergmann 0b3f31a1bb libcoap-1.{map,sym}: updated symbol map
This change adds the new symbol coap_flsll() introduced by
commit 9adc4eb6 to the shared symbol map.
2017-06-01 12:29:52 +02:00
Carsten Schoenert 0dafde8564 configure.ac: adjust the library vision +1
We are going into a new release cycle which will provide new so we need
new symbols and interfaces. Because of the new added symbols we need to
increase LT_LIBCOAP_CURRENT to '1'.
And we will be backward compatible and existing binaries linked against
the previous version will also working with that new planned library
release. To show this setting tune LT_LIBCOAP_AGE also to '1' as we are
now one version backward compatible.
2017-05-30 10:33:05 +02:00
Carsten Schoenert 90270db356 configure.ac: be more helpful on the libtool versioning
The versioning by libtool is sometimes a bit confusing and seems
complex. But it's really important to do a proper versioning of the
library.
Rephrase the part about how to check the needed versioning to be a bit
more informative how to do that.

Some more in deep explanation about the meaning of the libtool version
number can be found on:

* https://autotools.io/libtool/version.html
* http://www.informit.com/articles/article.aspx?p=19553
* https://developer.gnome.org/programming-guidelines/stable/versioning.html.en
2017-05-30 10:32:29 +02:00
Carsten Schoenert b432fa5f26 configure.ac: adding a release-state string
To do a more finely graduated versioning a extra new field for the
release-state is added. The purpose is mainly to add some extra
information about the development state of libcoap like a alpha state
right after a final release or marking the state as a release candidate
before a planned release.

Starting with a string 'alpha' as we are in a really early development
state for the upcoming release.
2017-05-30 10:31:25 +02:00
Carsten Schoenert 9aa7ee9d3a configure.ac: bumping version to 4.2.0
The next version will be 4.2.0 with some more new features and a license
change as well. More to come later.
2017-05-30 10:26:44 +02:00
jcmichelou 85ca4aab36 Fix size_t downcast to unsigned long warning. 2017-05-17 19:42:15 +02:00
jcmichelou fb2145094f Added x64 build of CUnit. 2017-05-17 19:31:56 +02:00
jcmichelou ab958ca586 Activate dual-stacked code first only on windows since on linux it is dependent on the version of the kernel. 2017-05-12 20:02:32 +02:00