See https://core-wg.github.io/oscore/test-spec5.html
Add in new test server oscore-interop-server to provide the necessary
functionality.
Add in script and configuration files to run the tests locally.
Based on work done in https://gitlab.informatik.uni-bremen.de/obergman/libcoap
New directories with files
include/oscore
src/oscore
New files
include/coap3/coap_oscore.h
include/coap3/coap_crypto_internal.h
include/coap3/coap_oscore_internal.h
man/coap-oscore-conf.txt.in
man/coap_oscore.txt.in
src/coap_oscore.c
tests/test_oscore.c
tests/test_oscore.h
Supported by new option (enabled by default)
./configure --enable-oscore
cmake .. -DENABLE_OSCORE=ON
Requires a TLS library configured to do the OSCORE encryption and hashing.
Add in new ./configure options --enable-client-mode or
--enable-server-mode which by default are enabled.
If --disable-client-mode is set, then disable all the client specific code.
[ COAP_CLIENT_SUPPORT is not defined ]
If --disable-server-mode is set, then disable all the server specific code.
[ COAP_SERVER_SUPPORT is not defined ]
Functions and variables are only #ifdef'd out in the include/coap3/*_internal.h
files. They cannot be #ifdef'd out in the other include files as
COAP_CLIENT_SUPPORT and COAP_SERVER_SUPPORT are not available for application
compilations. The result of this is if, say, client only API functons are used
in a server application and COAP_CLIENT_SUPPORT is not defined, there will be
linking issues (missing functions). Providing stub functions unecessarily
increases the code size.
For coap-server, if it is able to provide proxy support, requires both
COAP_SERVER_SUPPORT and COAP_CLIENT_SUPPORT to set up the ongoing sessions.
So, the build environment deliberatly sets SERVER_CAN_PROXY=0 if
COAP_CLIENT_SUPPORT is not available to allow linking.
Some of the tests have to be disabled if COAP_SERVER_SUPPORT or
COAP_CLIENT_SUPPORT is not set.
Code size change indications
text data bss sum filename
155912 1728 12080 169720 libcoap-3-notls.a
138300 1728 12080 152108 libcoap-3-notls.a --disable-client-mode
106734 1632 10304 118670 libcoap-3-notls.a --disable-server-mode
180485 1733 12080 194298 libcoap-3-openssl.a
160306 1733 12080 174119 libcoap-3-openssl.a --disable-client-mode
125543 1637 10304 137484 libcoap-3-openssl.a --disable-server-mode
181755 1728 12080 195563 libcoap-3-gnutls.a
160972 1728 12080 174780 libcoap-3-gnutls.a --disable-client-mode
127178 1632 10304 139114 libcoap-3-gnutls.a --disable-server-mode
165879 1855 12128 179862 libcoap-3-tinydtls.a
147022 1855 12128 161005 libcoap-3-tinydtls.a --disable-client-mode
115618 1759 10352 127729 libcoap-3-tinydtls.a --disable-server-mode
171690 1728 13744 187162 libcoap-3-mbedtls.a
152099 1728 13712 167539 libcoap-3-mbedtls.a --disable-client-mode
118786 1632 11984 132402 libcoap-3-mbedtls.a --disable-server-mode
This change adds 'SPDX-License-Identifier: BSD-2-Clause' [1] to
the source code files that originate in the libcoap project.
Note that not all files are tagged because they are pulled in
from other sources and thus may fall under a different license.
More information about these is contained in the LICENSE file.
[1] https://spdx.org/licenses/BSD-2-Clause.html
For example (when building OpenSSL variant), coap-client and
coap-client-openssl are identically built and debug information is being
abstracted, it complains that the two binaries are identical.
Make coap-server, coap-client and coap-rd non-installable, (they still need
to be built in the examples directory, so cannot use check_PROGRAMS) and then
soft-link them as appropriate in the target $(bindir).
If --enable-add-default-names is set (the default), then the installed default
libraries and installed default example executables will point to the
appropriate object that has the (D)TLS library type in the name. E.g.
libcoap-3.so -> libcoap-3-openssl.so
coap-client -> coap-client-openssl
If --enable-add-default-names is not set, then this will not happen.
As well as the libraries, the example binaries are now created with the (D)TLS
library extension in all cases.
Install in PREFIX/share/libcoap/examples the source for coap-client.c and
coap-server.c with a standalone Makefile for ease of standalone code
development.
Add in configure option --enable-examples-source.
Included is a README, LICENSE and COPYING.
Example applications are built against the libcoap public API
and therefore prefix libcoap includes with "coap3)/".
The only exception is coap-rd which uses uthash.h from the internal
API. Therefore, "-Iinclude/coap3" is additionally passed as CPPFLAG
for coap-rd.
This reverts commit 91bfd5b103 because
it introduced a wrong variable substitution:
The problem here is that top_srcdir is . in the top-level Makefile, so
the link command ends up having this:
[...] ../.libs/libcoap-2-tinydtls.a -L./ext/tinydtls -ltinydtls
Whereas, in examples/Makefile.am, top_srcdir is .., so using DTLS_LIBS
would be correctly replaced by
../.libs/libcoap-2-tinydtls.a -L../ext/tinydtls -ltinydtls
The same holds for the Makefile in the subdirectory tests.
Using the variable $(DTLS_LIBS) in the *_LDADD isn't correct, for
controlling the linker flags the *.la file is normally holding all the
required information.
This was introduced by 5687681d71 and is
partially removed by this commit.
When building outside the source tree compilation fails on
examples, because the libcoap headers expect to be all in the
same directory but coap.h is generated under the build
directory, so it is necessary to add an extra include path
for it.
Also, build directories should always appear before source
directories in the include path, so that any leftover
generated files in the source tree are ignored.
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))
The build environment was lacking the possibility to get libcoap
buildable out of tree, simply checkable by the running 'make distcheck'.
Without this fix the users are impossible to build libcoap in a own
folder that's independed from the source containing folder. Typical use
case would be:
$ mkdir libcoap-build && cd libcoap-build
$ /path/to/libcoap-source/configure \
--srcdir=/path/to/libcoap-source \
--prefix=/somethere/to-install
This commit enables the out of tree build by adding and changing some
needed variables.
The options --disable-documentation and --disable-examples did
not have the desired effect in some configurations. Now, if any
of documentation or examples is disabled, the manual pages in
the examples folder are not created.
The previous commit added some asciidoc based man pages that need a2x
from the asciidoc package. To ensure the build will not break due a not
available a2x binary we better check before.
This commmit adds the build of man pages for the binaries from the
example/ folder, in detail these are coap-client.5, coap-rd.5 and
coap-server.5.
The source of the man pages is written in asciidoc so the build
environment must have access to a installed asciidoc package.
To normalize (and in preparation for manpages) the currently used files
for the example implementation of a CoAP based client, server and a
resource directory various files and variables are rename to coap-*.
The build of the examples is complaining about a function that are not
inline'd. The compiler is mentioned this because we use the '-I'
directive for pointing to the header files. Just say the compiler also
that the header files are system headers so the false positive is going
away.
After including the doc/ and the tests/ folder under the hood of the
autotools now adding the examples/ foolder too.
The user is now able to add the build of the example binarys if
configure is called with '--enable-examples' as option. The example
binarys will not be build by default!
Currently only 'coap-client', 'coap-server' and 'rd' is build.