<p><b>@MichelRottleuthner</b> requested changes on this pull request.</p>

<p>Almost there! Another round of testing confirmed most of the tests/examples working in general now, apart from <code>examples/tls-wolfssl-posix</code> - but judging by your comments and the new PR, I think you are already working on that, right?<br>
Some things still needed small tweaks to work on all of the platforms I tested, see below for details.<br>
Merging before the summit won't happen anymore - but maybe we can make it there ;)</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320364510">examples/dtls-wolfssl/Makefile</a>:</p>
<pre style='color:#555'>> +# Include packages that pull up and auto-init the link layer.
+# 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 UDP
+USEMODULE += gnrc_ipv6_default
+USEMODULE += gnrc_sock_udp
+
+# Add also the shell, some shell commands
+USEMODULE += shell
+USEMODULE += shell_commands
+
+USEPKG += wolfssl
+USEMODULE += wolfcrypt
+USEMODULE += wolfssl
+USEMODULE += wolfcrypt-test
</pre>
<p>wolfcrypt-test can be removed here to save some RAM as there is already the separate test/bench application</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320365678">examples/dtls-wolfssl/Makefile</a>:</p>
<pre style='color:#555'>> +USEMODULE += gnrc_sock_udp
+
+# Add also the shell, some shell commands
+USEMODULE += shell
+USEMODULE += shell_commands
+
+USEPKG += wolfssl
+USEMODULE += wolfcrypt
+USEMODULE += wolfssl
+USEMODULE += wolfcrypt-test
+USEMODULE += wolfssl_dtls
+
+# Select public key algorithm (or PSK) support fot ciphersuite(s):
+USEMODULE += wolfcrypt_ecc
+#USEMODULE += wolfcrypt_rsa wolfcrypt_dh
+#USEMODULE += wolfssl_psk
</pre>
<p>I'd favor to use the wolfssl_psk configuration as default as it should be least problematic for running on very constrained nodes</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320366896">examples/dtls-wolfssl/dtls-client.c</a>:</p>
<pre style='color:#555'>> +        }
+
+        return 32;   /* length of key in octets or 0 for error */
+    }
+}
+#endif
+
+#define APP_DTLS_BUF_SIZE 64
+int dtls_client(int argc, char **argv)
+{
+    int ret = 0;
+    char buf[APP_DTLS_BUF_SIZE] = "Hello from DTLS client!";
+    int iface;
+    char *addr_str;
+    int connect_timeout = 0;
+    const int max_connect_timeouts = 5;
</pre>
<p>please increase this number. With five It didn't work for me on samr21-xpro / nucleo-l476rg, whereas 20 was working perfectly fine</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320367548">examples/dtls-wolfssl/dtls-client.c</a>:</p>
<pre style='color:#555'>> +    else {
+        int i;
+        int b = 0x01;
+
+        for (i = 0; i < 32; i++, b += 0x22) {
+            if (b >= 0x100)
+                b = 0x01;
+            key[i] = b;
+        }
+
+        return 32;   /* length of key in octets or 0 for error */
+    }
+}
+#endif
+
+#define APP_DTLS_BUF_SIZE 64
</pre>
<p>minor, but having all defines together somewhere at the top of the file feels cleaner</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320380310">examples/tls-wolfssl-posix/wolfssl-server.c</a>:</p>
<pre style='color:#555'>> + * 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 server example
+ *
+ * @author      Kaleb J. Himes <kaleb@wolfssl.com>
+ *
+ * @}
+ */
+
</pre>
<p>please add the following here so that strnlen is provided on all platforms:</p>
<div class="highlight highlight-source-c"><pre><span class="pl-c"><span class="pl-c">/*</span> Required for strnlen in string.h, when building with -std=c99 <span class="pl-c">*/</span></span>
#<span class="pl-k">define</span> <span class="pl-en">_DEFAULT_SOURCE</span> <span class="pl-c1">1</span> </pre></div>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320382297">tests/wolfcrypt-ed25519-verify/Makefile</a>:</p>
<pre style='color:#555'>> +                   arduino-uno chronos esp8266-esp-12x esp8266-olimex-mod \
+                   esp8266-sparkfun-thing jiminy-mega256rfr2 mega-xplained \
+                   msb-430 msb-430h telosb waspmote-pro \
+                   wsn430-v1_3b wsn430-v1_4 z1
+
+# This has to be the absolute path to the RIOT base directory:
+RIOTBASE ?= $(CURDIR)/../..
+
+# 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:
+DEVELHELP ?= 1
+
+# Change this to 0 show compiler invocation lines by default:
+QUIET ?= 1
+
</pre>
<p>please add the following to avoid a hardfault on small platforms (e.g. amr21-xpro) after finishing the signature verification is complete:</p>
<pre><code>CFLAGS += -DTHREAD_STACKSIZE_MAIN=THREAD_STACKSIZE_LARGE
</code></pre>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320384503">tests/wolfssl-test/Makefile</a>:</p>
<pre style='color:#555'>> +#
+# BOARD_INSUFFICIENT_MEMORY :=
+
+# 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 is an optimized stack value based on testing, if you observe
+# a segmentation fault please increase this stack size.
+CFLAGS += -DTHREAD_STACKSIZE_MAIN=35000
</pre>
<p>please change this to the following to have a big enough (but platform specific) stacksize to make it work on embedded targets:<br>
<code>CFLAGS += -DTHREAD_STACKSIZE_MAIN=2*THREAD_STACKSIZE_LARGE</code></p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/10308#discussion_r320386309">tests/wolfssl-test/main.c</a>:</p>
<pre style='color:#555'>> + *
+ * @}
+ */
+
+#include <stdio.h>
+
+#include <wolfssl/wolfcrypt/settings.h>
+#include <wolfcrypt/test/test.h>
+#ifdef MODULE_WOLFCRYPT_BENCHMARK
+#include <wolfcrypt/benchmark/benchmark.h>
+#endif
+
+int main(void)
+{
+    puts("wolfSSL Crypto Test!");
+    wolfcrypt_test(NULL);
</pre>
<p>please add <code>xtimer_sleep(1);</code> before calling <code>wolfcrypt_test</code> (and the required <code>#include "xtimer.h"</code> to the top) to workaround a failing test on platforms that don't have a synced RTC, as I explained in <a href="https://github.com/RIOT-OS/RIOT/pull/10308#issuecomment-519430658" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/10308/hovercard">one of my previous comments</a>.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/10308?email_source=notifications&email_token=ABE7WYFTBWUHH36UWVJN2HTQH2NTHA5CNFSM4GAXZVZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDQABAI#pullrequestreview-283115649">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYGWEY6KU3VP5TMQESTQH2NTHANCNFSM4GAXZVZQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYF22X2ICVJYR2D7JWLQH2NTHA5CNFSM4GAXZVZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDQABAI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/10308?email_source=notifications\u0026email_token=ABE7WYFTBWUHH36UWVJN2HTQH2NTHA5CNFSM4GAXZVZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDQABAI#pullrequestreview-283115649",
"url": "https://github.com/RIOT-OS/RIOT/pull/10308?email_source=notifications\u0026email_token=ABE7WYFTBWUHH36UWVJN2HTQH2NTHA5CNFSM4GAXZVZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDQABAI#pullrequestreview-283115649",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>