[riot-notifications] [RIOT-OS/RIOT] wolfSSL pkg addition with examples (#10308)

MichelRottleuthner notifications at github.com
Tue Sep 10 18:10:16 CEST 2019


MichelRottleuthner requested changes on this pull request.

Re-tested everything on native nucleo-l476rg and samr21-xpro:
Pass: ✓ Fail:✗

| test | native | nucleo-l476rg | samr21-xpro |
| --------------|---|---|---|
| examples/dtls-wolfssl (psk) | ✓ | ✓ | ✓ |
| examples/dtls-wolfssl (ecc) | ✓ | ✓ | ✓ |
| examples/dtls-wolfssl (rsa) | ✓ | ✓ | ✗* |
| tests/pkg_wolfssl | ✓ | ✓ | ✓ |
| tests/pkg_wolfcrypt-ed25519-verify | ✓ | ✓ | ✓ |

*expected due to memory constraints

Please just fix the small (nitpicky but quickly to do) doc/style things noted below. Feel free to directly ammend/squash and thats's it!

> +USEPKG += wolfssl
+USEMODULE += wolfcrypt
+USEMODULE += wolfssl
+USEMODULE += wolfssl_dtls
+
+# Select public key algorithm (or PSK) support fot ciphersuite(s):
+#USEMODULE += wolfcrypt_ecc
+#USEMODULE += wolfcrypt_rsa wolfcrypt_dh
+USEMODULE += wolfssl_psk
+
+# Uncomment the following line to add debug symbols
+#CFLAGS+=-g -ggdb3
+
+CFLAGS += -DDTLS_DEFAULT_PORT=$(DTLS_PORT) -DDTLS_WOLFSSL -Wno-unused-parameter -Wno-unused-variable
+
+# FIXME: This is a temporary patch taken from the TinyDTLS example to ensure proper stack allocation

This FIXME comment can be removed, or better replaced with a comment explaining that changing this value is very likely required when changing the psk above to ecc or even rsa.

> +  USEMODULE += printf_float
+  USEMODULE += xtimer
+endif
+
+ifneq (,$(filter wolfcrypt_poly1305,$(USEMODULE)))
+  ifneq (,$(filter wolfcrypt_chacha,$(USEMODULE)))
+    USEMODULE += wolfcrypt_chacha20_poly1305
+  endif
+endif
+
+ifneq (,$(filter wolfcrypt_ed25519,$(USEMODULE)))
+    USEMODULE += wolfcrypt_sha512
+endif
+
+ifneq (,$(filter wolfcrypt_aes,$(USEMODULE)))
+    USEMODULE += wolfcrypt_cmac

please align the indents to the style we use in our other Makefile.dep files (ie.e two spaces per level)

> + * Very small footprint application to demonstrate
+ * Ed25519 signature verification with a very small footprint
+ * and memory requirements
+ *
+ * ```makefile
+ * cd <path-to>/RIOT/tests/wolfcrypt-ed25519-verify
+ * make
+ * ./bin/native/wolfcrypt-ed25519-verify.elf # execute native port
+ * ```
+ *
+ *
+ * DTLS Client and Server Example
+ * DTLS example over GNRC UDP/IP stack.
+ * See documentation in `examples/dtls-wolfssl/README.md`
+ *
+ * TLS Client and server Example

please remove this paragraph for now as the posix example is no longer part of this PR

> +#endif
+
+#undef NO_SHA
+#ifndef MODULE_WOLFCRYPT_SHA
+#   define NO_SHA
+#else
+#   define USE_SLOW_SHA
+#   define USE_SLOW_SHA2
+#endif
+
+#undef HAVE_SHA512
+#undef HAVE_SHA384
+#undef WOLFSSL_SHA384
+#undef WOLFSSL_SHA512
+#ifdef MODULE_WOLFCRYPT_SHA512
+#   define HAVE_SHA384

while I personally actually prefer this indented style for ifdefs the common style in the repo is to not indent them. please adapt

> +#
+BOARD_INSUFFICIENT_MEMORY := nucleo-f042k6 stm32f0discovery nucleo-f334r8 \
+                             i-nucleo-lrwan1 nucleo-f302r8 nucleo-l053r8 saml11-xpro \
+                             nucleo-l031k6 bluepill stm32l0538-disco saml10-xpro \
+                             nucleo-f030r8 nucleo-f031k6 nucleo-f303k8 blackpill
+
+# This has to be the absolute path to the RIOT base directory:
+RIOTBASE ?= $(CURDIR)/../..
+
+# Used for inserting debug symbols into library for portability
+# testing on Ubuntu 16.04 LTS w/ gcc v 5.4.0
+#CFLAGS += -g
+#LDFLAGS += -g
+
+# Necessary to set the stacksize on Ubuntu Native device when using
+# gcc v 5.4.0 on 16.04 LTS

this comment regarding ubuntu and compiler version should be removed as it is not really depending on that.

> + *
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+
+/**
+ * @ingroup     examples
+ * @{
+ *
+ * @file
+ * @brief       wolfSSL cryptographic library test
+ *
+ * @author      Kaleb J. Himes <kaleb at wolfssl.com>

@danielinux please also add yourself as an author

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10308#pullrequestreview-286239939
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190910/cfef8d58/attachment.htm>


More information about the notifications mailing list