12 Commits

Author SHA1 Message Date
Achim Kraus
d7b94c0fe7 dtls_debug.c: fix minor bug with zero termination.
Providing a too small buffer may result in missing the zero termination.
This adds an assert to ensure, that the buffer is large enough.

Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
2022-01-21 09:15:36 +01:00
Jon Shallow
a37ba81034 Use of -Wwrite-strings and -Wextra throw up compiler warnings
dtls.c:
Add in const for dtls_handshake_type_to_name()

dtls_debug.[ch]:

Add in const where appropriate for dsrv_log().
In addition, get dsrv_log() to check printf syntax.

sha2/sha2.c:

Re-order "const static" to "static const" and add in needed const.

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2019-04-01 15:43:01 +01:00
Olaf Bergmann
84f1f4e3ca dtls_debug.c: removed pathologic use of NDEBUG
Change-Id: I4005b671fce0e27e028b6bc1d109e1a2bac3d88f
2018-04-13 11:13:20 +02:00
Olaf Bergmann
50b2fb5cd5 dtls_debug.[ch]: move helper functions to .c file
Some helper functions such as hexdump() were declared as empty
when the NDEBUG symbol was defined. To clean up the API, the
actual implementation now is moved from dtls_debug.h (were it
was inlined) to dtls_debug.c.

Change-Id: I465f35310e1c64eb59e122a06ae79880fa21aec1
2018-02-16 10:27:27 +01:00
Raul Fuentes
3993d52800 dtls_debug.[ch] Adding (void) lines and initial RIOT support
NOTE: RIOT OS own lines for debugging and print must be used
      in future patch.

Change-Id: I8733215fd0c649c02a4ecfd8587d1916f020f4b8
Signed-off-by: Raul Fuentes <ra.fuentes.sam@gmail.com>
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2018-02-16 10:27:27 +01:00
Raul Fuentes
9e40ab6b11 dtls_debug.c: Removing trailing whitespace and adding (void) lines
Change-Id: Iacd6e2d53ca1429d98e9f06c2cf411b9a59d50ed
Signed-off-by: Raul Fuentes <ra.fuentes.sam@gmail.com>
2018-02-08 16:43:15 +01:00
Gaëtan Harter
43c7265e0b contiki: re-add dtls_package_name and dtls_package_version
Statically define PACKAGE_NAME and PACKAGE_VERSION in contiki platform header.
This will require maintaining them in addition to values in configure.ac.

Change-Id: I08948dfdb4ddeafeed273a917367ee5ad237df8f
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
2017-03-01 13:55:56 +01:00
Olaf Bergmann
320c04b96d Fixes for compiler warnings
The code has been cleaned up to
1. provide proper prototypes for functions that take no arguments (void),
2. avoid signedness issues, and
3. provide missing cases for switch statements.

Change-Id: I9e84ddb9ef6594c374ad817330a43b22642ebb33
2017-03-01 13:32:14 +01:00
Olaf Bergmann
53756a6cd0 dtls_debug.c: fix output of IP addresses for Contiki
* UIP_CONF_IPV6 is now called NETSTACK_CONF_WITH_IPV6
* As sprintf() is used anyway when NDEBUG is not set, we can also
  use it for printing IPv4 addresses.

Change-Id: I91247ba0292c23a2e389a4a6a8f15c6204473b5f
2017-02-28 15:02:11 +01:00
Gaëtan Harter
080013fd2d contiki: work without running configure
When building with contiki, 'CONTIKI' is defined and is used to detect contiki.
Configure options can be configured with:

    DTLS_CONF_ECC, DTLS_CONF_PSK, DTLS_CONF_NDEBUG

All files now include 'tinydtls.h' instead of 'dtls_config.h'.

Change-Id: I9a558a7d6bd777656d7b29028852bfc08911b8b7
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
2017-02-27 18:05:10 +01:00
Gaëtan Harter
c9adbab655 tinydtls.h: include dtls_config.h in tinydtls.h
Fixes dtls_config.h not visible in headers
Include dtls_config.h in tinydtls.h and include tinydtls.h in all necessary
headers.

Remaining headers do not use 'ifdef', but they may require it too.

Change-Id: I39c86dffc8bbc8bd7551e74386994f92f49d00ec
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
2017-02-27 18:05:10 +01:00
Olaf Bergmann
f623c23ba4 renamed debug.[hc] to dtls_debug.[hc] to avoid naming conflicts 2016-03-08 12:47:11 +01:00