From 4f576285bb1210c2a6d1ce4b05981d57cb4232db Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 30 Nov 2022 10:46:30 +0100 Subject: [PATCH] sys/suit: accept coaps:// URLs --- sys/suit/handlers_command_seq.c | 3 ++- sys/suit/transport/worker.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/suit/handlers_command_seq.c b/sys/suit/handlers_command_seq.c index c18e674e95..f8b63ea292 100644 --- a/sys/suit/handlers_command_seq.c +++ b/sys/suit/handlers_command_seq.c @@ -438,7 +438,8 @@ static int _dtv_fetch(suit_manifest_t *manifest, int key, if (0) {} #ifdef MODULE_SUIT_TRANSPORT_COAP - else if (strncmp(manifest->urlbuf, "coap://", 7) == 0) { + else if ((strncmp(manifest->urlbuf, "coap://", 7) == 0) || + (IS_USED(MODULE_NANOCOAP_DTLS) && strncmp(manifest->urlbuf, "coaps://", 8) == 0)) { res = nanocoap_get_blockwise_url(manifest->urlbuf, CONFIG_SUIT_COAP_BLOCKSIZE, _storage_helper, manifest); diff --git a/sys/suit/transport/worker.c b/sys/suit/transport/worker.c index 1a32bc350c..a54022fb28 100644 --- a/sys/suit/transport/worker.c +++ b/sys/suit/transport/worker.c @@ -87,7 +87,8 @@ int suit_handle_url(const char *url) if (0) {} #ifdef MODULE_SUIT_TRANSPORT_COAP - else if (strncmp(url, "coap://", 7) == 0) { + else if ((strncmp(url, "coap://", 7) == 0) || + (IS_USED(MODULE_NANOCOAP_DTLS) && strncmp(url, "coaps://", 8) == 0)) { size = nanocoap_get_blockwise_url_to_buf(url, CONFIG_SUIT_COAP_BLOCKSIZE, _manifest_buf,