[riot-notifications] [RIOT-OS/RIOT] sock/dtls: add function to retrieve epoch of session (#15881)

benpicco notifications at github.com
Fri Jan 29 21:47:13 CET 2021


@benpicco commented on this pull request.



> @@ -296,6 +296,19 @@ int sock_dtls_create(sock_dtls_t *sock, sock_udp_t *udp_sock,
     return 0;
 }
 
+int16_t sock_dtls_session_get_epoch(sock_dtls_t *sock, sock_dtls_session_t *session)
+{
+    assert(sock);
+    assert(session);
+
+    dtls_peer_t *peer = dtls_get_peer(sock->dtls_ctx, &session->dtls_session);
+    if (!peer) {
+        return -ENOTCONN;
+    }
+    dtls_security_parameters_t *security = dtls_security_params(peer);

Is there a chance of `security` being NULL?

-- 
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/15881#pullrequestreview-579606512
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210129/23353aee/attachment.htm>


More information about the notifications mailing list