Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Module GDTLS #7177

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@ ifneq (,$(filter spiffs,$(USEMODULE)))
USEMODULE += mtd
endif

ifneq (,$(filter gnrc_dtls,$(USEMODULE)))
USEPKG += tinydtls
endif

ifneq (,$(filter l2filter_%,$(USEMODULE)))
USEMODULE += l2filter
endif
Expand All @@ -618,6 +622,10 @@ USEPKG += nanocoap
USEMODULE += gnrc_sock_udp
endif

ifneq (,$(filter gnrc_dtls,$(USEMODULE)))
USEPKG += tinydtls
endif

# include package dependencies
-include $(USEPKG:%=$(RIOTPKG)/%/Makefile.dep)

Expand Down
56 changes: 28 additions & 28 deletions examples/dtls-echo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ RIOTBASE ?= $(CURDIR)/../..

# TinyDTLS only has support for 32-bit architectures ATM
BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno chronos \
msb-430 msb-430h telosb waspmote-pro wsn430-v1_3b wsn430-v1_4 \
z1 \
nrf52dk # see #6022
mips-malta msb-430 msb-430h pic32-clicker pic32-wifire \
telosb waspmote-pro wsn430-v1_3b wsn430-v1_4 z1

BOARD_INSUFFICIENT_MEMORY := airfy-beacon calliope-mini cc2650stk maple-mini \
microbit nrf51dongle nrf6310 nucleo32-f031 \
Expand All @@ -24,52 +23,53 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon calliope-mini cc2650stk maple-mini \
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
USEMODULE += gnrc_netdev_default
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules for IPv6 and sUDP
# Specify the mandatory networking modules for IPv6 and UDP
USEMODULE += gnrc_ipv6_router_default
USEMODULE += gnrc_udp
# Add a routing protocol
USEMODULE += gnrc_sock_udp
# Add a routing protocol (optional)
USEMODULE += gnrc_rpl
# This application dumps received packets to STDIO using the pktdump module
USEMODULE += gnrc_pktdump

# Additional networking modules that can be dropped if not needed
USEMODULE += gnrc_icmpv6_echo
# Add also the shell, some shell commands
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps

#TinyDTLs (crypto.c) made use of pthread
ifneq ($(BOARD),native)
USEMODULE += pthread
endif
# Uncomment to redefine port. Default: DTLS port (20220). Useful for FEBx range
#DTLS_PORT = 20220
#CFLAGS += -DDTLS_DEFAULT_PORT=$(DTLS_PORT)

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
CFLAGS += -DDEVELHELP
# DTLS-client will generate a "CoAP get /riot/value" message instead of
# sending the user input
#CFLAGS += -DCOAP_MSG_SPOOF

# NOTE: Add the package for TinyDTLS
USEPKG += tinydtls
# NOTE: The following lines are custom configuration for TinyDTLS

# NOTE: Those are taken from TinyDTLS. As the original Makefiles are
# overwitten is a good idea to preserve them here.
CFLAGS += -DDTLSv12 -DWITH_SHA256
USEPKG += tinydtls

# NOTE: This adds support for TLS_PSK_WITH_AES_128_CCM_8
# This adds support for TLS_PSK_WITH_AES_128_CCM_8
CFLAGS += -DDTLS_PSK
# This adds support for TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
#CFLAGS += -DDTLS_ECC

# NOTE: This adds support for TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
CFLAGS += -DDTLS_ECC

# NOTE: If enabled TinyDTLS' log are disabled (if memory is a issue).
# WARNING: Sometimes the log leads to Stack pointer corrupted.
# The reason is not identified yet.
# If said issue appears, enable this line.
# If enabled TinyDTLS' logs are disabled (if memory is an issue).
#CFLAGS += -DNDEBUG

# NOTE: Although dtls-echo can run with default value. The use of ECC curves
# seems to require more memory for the threads.
# TODO: A more deep memory evaluation is required
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(3*THREAD_STACKSIZE_DEFAULT\)

# NOTE: The configuration for socket or non-socket communication in TinyDTLS.
CFLAGS += -DWITH_RIOT_GNRC

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
CFLAGS += -DDEVELHELP

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

Expand Down
Loading