[riot-notifications] [RIOT-OS/RIOT] wolfSSL pkg addition with examples (#10308)
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>
+void sock_dtls_close(sock_tls_t *sk)
+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.
+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...
More information about the notifications