-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nanocoap_sock: implement DTLS socket #18724
Conversation
Does it really make sense to add the complexity of DTLS into |
300 lines is hardly that much complexity. NanoCoAP can be used for much more than firmware updates and if you don't enable Also AFAIK we do not have an OSCORE implementation yet. |
4874932
to
3d0b9e2
Compare
Last time I checked, TinyDTLS had much more than 300 lines of code...
Here you go: https://gitlab.com/oscore/liboscore/-/tree/master/tests/riot-tests :-) |
I agree with @benpicco. After all, we need to maintain the TinyDTLS package anyway. So we can just as well make use of it where sensible. The added complexity to nanocoap is quite manageable. |
3d0b9e2
to
6cc934a
Compare
929424f
to
4f57628
Compare
Thank you for the review! bors merge |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
4 similar comments
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
Stopped waiting for PR status (GitHub check) without running due to duplicate requests to run. You may check Bors to see that this PR is included in a batch by one of the other requests. |
bors merge |
Already running a review |
18459: makefiles/suit: make it possible to accept multiple SUIT keys r=benpicco a=benpicco 18724: nanocoap_sock: implement DTLS socket r=benpicco a=benpicco 18763: sys/tiny_strerror: add missing error codes r=maribu a=maribu ### Contribution description When double-checking the error codes provided by newlib by default (without magic defines, such as `__LINUX_ERRNO_EXTENSIONS__` or `__CYGWIN__`), some where still missing in `tiny_strerror()`. This adds the missing ones. This in turn showed that three errno codes were missing in the avr-libc compat `errno.h`, which are added as well. ### Testing procedure Murdock should double check that the added errno codes indeed are defined by default. ### Issues/PRs references None Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de> Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
This PR was included in a batch that was canceled, it will be automatically retried |
18459: makefiles/suit: make it possible to accept multiple SUIT keys r=kaspar030 a=benpicco 18724: nanocoap_sock: implement DTLS socket r=benpicco a=benpicco 18763: sys/tiny_strerror: add missing error codes r=maribu a=maribu ### Contribution description When double-checking the error codes provided by newlib by default (without magic defines, such as `__LINUX_ERRNO_EXTENSIONS__` or `__CYGWIN__`), some where still missing in `tiny_strerror()`. This adds the missing ones. This in turn showed that three errno codes were missing in the avr-libc compat `errno.h`, which are added as well. ### Testing procedure Murdock should double check that the added errno codes indeed are defined by default. ### Issues/PRs references None 19136: CI: re-add "synchronize" event to check-labels r=kaspar030 a=kaspar030 Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de> Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Build failed (retrying...): |
bors retry |
Already running a review |
bors cancel |
Canceled. |
bors merge |
Already running a review |
Build succeeded: |
Contribution description
This implements DTLS support for NanoCoAP.
When the
nanocoap_dtls
module is used, thenanocoap_sock_t
struct is extended with session information.All NanoCoAP API functions will automatically handle the new transport type,
nanocoap_sock_url_connect()
will automatically select the DTLS socket when acoaps://
URL is used.I'm a bit confused by credman. I now define a
CONFIG_NANOCOAP_SOCK_DTLS_TAG
by which NanoCoAP can get the credential tag to select the right credential for the connection without having to add new parameter to the API. This is convenient, but it only allows a single credential to be used with NanoCoAP (which is probably fine for the use case, there is only ever a single endpoint).Testing procedure
The
tests/nanocoap_cli
application works without modification. I usedexamples/gcoap_dtls
for the server:log of a nanocoap_cli session
add fileserver to gcoap_dtls
Issues/PRs references