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

Marian Buschsieweke notifications at github.com
Thu Sep 5 20:57:24 CEST 2019

maribu commented on this pull request.

I'd love to see this merged. Some comments inline, and also this: You could use [log](https://api.riot-os.org/log_8h.html) instead of printf, which would allow users to reduce ROM size by reducing the verbosity.

Alls these changes have intentionally not marked as "changes required", as all are non-blocking comments that you may ignore.

> + * @param[in] addr      Remote end point for the DTLS session.
+ *
+ */
+void sock_dtls_set_endpoint(sock_tls_t *sk, const sock_udp_ep_t *addr);
+ * @brief   Creates a new DTLS session from an existing `sock_tls_t` object.
+ *
+ * @pre `(sk != NULL)`
+ *
+ * @param[in] sk      The sock object previously created using @ref sock_dtls_create
+ *
+ * @return  0 on success.
+ * @return  -EINVAL, if @sock is null or the SSL context is not initialized yet.
+ * @return  -ENOMEM, if not enough resources can be provided for the session to be
+ *          created

You could use `@retval` here. (Comment only, not insisting.)

> +#include <stdlib.h>
+#include <stdio.h>
+#include <net/sock.h>
+#include <wolfssl/ssl.h>
+#include <wolfssl/internal.h>
+void sock_dtls_close(sock_tls_t *sk)
+    sock_udp_close(&sk->conn.udp);
+void sock_dtls_set_endpoint(sock_tls_t *sk, const sock_udp_ep_t *addr)
+    printf("wolfSSL: Setting peer address and port\n");
+    memcpy(&sk->peer_addr, addr, sizeof (sock_udp_ep_t));

I don't get why here `memcpy()` is used and later `XMEMCPY()` is used. My gut feeling is that this is unintentional. (Remark, not insisting on changes.)

> @@ -0,0 +1,78 @@
+ * Copyright (C) 2019 Daniele Lacamera
+ *
+ * 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.
+ *
+ */
+#include <stdint.h>
+#include <wolfssl/wolfcrypt/settings.h>
+#include <wolfssl/wolfcrypt/ed25519.h>
+void print_buf(uint8_t *buf, int len)

(Again, comment only): You could use module `ocd` here to safe some lines of code here

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190905/56860668/attachment.htm>

More information about the notifications mailing list