RFC: secure_sock - Integration of (D)TLS stacks for RIOT O.S. #7397
Description
Briefly discussed in the PR #7177, further work for integrating DTLS to RIOT OS must be adhered to RIOT philosophy. And therefore, the previous PR, although functional, should be upgraded.
Edited: This post was edited to reflect the main critiques (up to July/2017).
---------------------------------------------------
| |
| Application / Library |
| |
---------------------------------------------------
|
| secure_sock_api
---------------------------------------------------
| |
| Secure_Sock |
| |
| ---------------------------------- |
| | TLSMAN | |
| | | |
| | ------------- ------------- | |
| | | tinydtls | | WolfSSL | | |
| | | | | | | |
| | ------------- ------------- | |
| ---------------------------------- |
---------------------------------------------------
| |
| sock_tcp | sock_udp
| |
. .
. .
. .
This is the proposition of the first API for handling secure communication with RIOT O.S. This first API is intended to be the main API for the users and applications.
secure_sock tries to mimic standard socks functions (create
, send
, receive
) for making easy the integration of a (D)TLS layer to current applications (like gcoap).
It's important to note that with this API the endpoints and socks are not defined as TCP or UDP because that is determined by the (D)TLS stack used for the application, which is handled by the second API.
The second API, TLSMAN
(TLS Manager) configures, handles and transmit the handshake messages as well the encrypted upper layer data. The API's objective is to make relatively easy to adding support for other TLS stacks than tinyDTLS in the future (By example wolfSSL and mbedTLS) without impacting (too much) on already defined applications.
Any suggestions or comments?