1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

4464 Commits

Author SHA1 Message Date
Marian Buschsieweke
cec85cfc88
Merge pull request #20945 from maribu/sys/net/gcoap/replace-super-insane-hack-with-less-insane-hack
sys/net/gcoap: reduce insanity of hack
2024-11-08 20:03:37 +00:00
Marian Buschsieweke
2b6f65a08a
build_system/xfa: change API to fix alignment
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
2024-11-07 16:30:01 +01:00
Marian Buschsieweke
68beb52f14
sys/net/nanocoap: add and use coap_get_response_hdr_len()
Before, handlers writing blockwise transfer assumed that the response
header length will match the request header length. This is true for
UDP, but not for TCP: The CoAP over TCP header contains a Len field,
that gets extended for larger messages. Since the reply often is indeed
larger than the request, this is indeed often the case for CoAP over
TCP.

Note: Right now, no CoAP over TCP implementation is upstream. However,
      getting rid of incorrect assumptions now will make life easier
      later on.
2024-11-05 10:46:02 +01:00
Marian Buschsieweke
765dc3a299
sys/net/gcoap: reduce insanity of hack
gcoap contains a hack where a `coap_pkt_t` is pulled out of thin air,
parts of the members are left uninitialized and a function is called on
that mostly uninitialized data while crossing fingers hard that the
result will be correct. (With the current implementation of the used
function this hack does actually work.)

Estimated level of insanity: 😱😱😱😱😱

This adds to insane functions to get the length of a token and the
length of a header of a CoAP packet while crossing fingers hard that
the packet is valid and that the functions do not overread.

Estimated level of insanity: 😱😱😱

The newly introduced insane functions are used to replace the old
insane hack, resulting in an estimated reduction of insanity of 😱😱.

Side note: This actually does fix a bug, as the old code did not take
           into account the length of the extended TKL field in case of
           RFC 8974 being used. But that is a bug in the abused API,
           and not in the caller abusing the API.
2024-11-01 16:32:59 +01:00
Marian Buschsieweke
469edf4827
sys/net/nanocoap: fix coap_get_total_hdr_len()
Before `coap_get_total_hdr_len()` did not take the extended TKL field
(RFC 8974) into account. This fixes the issue.
2024-11-01 13:58:34 +01:00
mguetschow
00e25adfe3
Merge pull request #20720 from netd-tud/chacha20-glue-code-implementation
sys/psa_crypto: one-shot Chacha20 support
2024-10-29 16:52:30 +00:00
Marian Buschsieweke
49c151e432
sys/luid: luid_custom() use fixed width int
This changes the type of the last parameter of `luid_custom()` to a
fixed width integer for consistent behavior among different
architectures.
2024-10-28 14:51:44 +01:00
Teufelchen
b376bec667
Merge pull request #20847 from benpicco/event_assert
sys/event: add assertion that event has a handler
2024-10-25 08:11:51 +00:00
benpicco
ae36fa4b37
Merge pull request #20921 from Vjorald/cord-doc
sys/net/app/cord: update doc
2024-10-24 16:59:01 +00:00
benpicco
c48247f984
Merge pull request #20916 from derMihai/mir/event_sync_mainline
sys/event: add event_sync()
2024-10-21 09:55:56 +00:00
Vjorald
d4fb64cfbc cord/doc: Update references to RFC 9176 2024-10-18 23:52:35 +02:00
Mihai Renea
9996909b65 sys/event: add event_sync() 2024-10-18 13:14:04 +02:00
benpicco
bada659375
Merge pull request #20918 from maribu/sys/net/nanocoap/coap_pkt_set_code
sys/nanocoap: add coap_pkt_set_code()
2024-10-17 16:02:19 +00:00
Marian Buschsieweke
f16875b6ec
sys/nanocoap: add coap_pkt_set_code()
This adds a small convenience function to set the CoAP code of a packet
and converts users of coap_hdr_set_code() where applicable.
2024-10-17 14:56:54 +02:00
Marian Buschsieweke
835571c0a7
sys/net/nanocoap: fix UB when building hdr
Some calls to `coap_build_hdr()` were done with the target buffer for
the header and the source buffer for the token overlapping:
They reuse the buffer that held the request to assemble the response in.
We cannot use `memcpy()` in this case to copy the token into the target
buffer, as source and destination would (fully) overlap.

This commit makes reusing the request buffer for the response a special
case: `memcpy()` is only used to copy the token if source and
destination address of the token differ.

An alternative fix would have been to use `memmove()` unconditionally.
But `memmove()` does not make any assumption about the layout of target
and source buffer, while we know that the token either will already be
at the right position (when reusing the request buffer for the response)
or be in a non-overlapping buffer (when generating a fresh token). This
approach is more efficient than `memmove()`.
2024-10-17 14:02:06 +02:00
Wunderbaeumchen
b9396c4739 sys/psa_crypto: chacha20 oneshot gluecode 2024-10-17 10:25:59 +02:00
benpicco
3706589959
Merge pull request #20834 from derMihai/mir/nib/drop_for_unreachable_rebase
gnrc/ipv6/nib: don't queue packets on 6lo neighbors and drop/flush if…
2024-10-16 09:16:40 +00:00
Mihai Renea
3a5612ee57 gnrc/ipv6/nib: don't queue packets on 6lo neighbors and drop/flush if UNREACHABLE 2024-10-16 09:01:36 +02:00
Fabian Hüßler
90473c62f0 sys/event: add event_periodic_start_now() 2024-10-14 21:17:38 +02:00
Fabian Hüßler
2b682585a7 sys/ztimer: add ztimer_periodic_start_now() 2024-10-14 21:15:50 +02:00
Mikolai Gütschow
f0e6776d40
treewide: apply codespell corrections 2024-10-09 13:03:52 +02:00
benpicco
5c06502c4d
Merge pull request #20835 from xnumad/nib-route-hide-on-link-prefixes
gnrc/ipv6: `nib route`: hide off-link PLEs
2024-09-24 15:42:48 +00:00
mguetschow
5d958957be
Merge pull request #20854 from netd-tud/psa-headers
Various PSA Crypto fixes
2024-09-18 08:10:44 +00:00
Armin Wolf
fe56b7d19c sys/psa_crypto: Implement PSA_MAC_MAX_SIZE()
This support macro is necessary for full MAC support.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
2024-09-17 21:37:10 +02:00
Armin Wolf
98d268040a sys/psa_crypto: Implement PSA_HASH_BLOCK_LENGTH()
The initial implementation was inspired by MbedTLS, with the
addition of the MD2 and MD4 algorithms.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
2024-09-17 21:37:10 +02:00
Fabian Hüßler
02e513e04b sys/include/net: better documentation of nanocoap_sock_request_cb 2024-09-10 16:44:19 +02:00
Fabian Hüßler
95b46ee2a5 sys/net/application_layer/nanocoap: add nanocoap_sock_get_non 2024-09-10 16:43:44 +02:00
Armin Wolf
d0c4e01ca3 sys/psa_crypto: Move PSA status definition to separate file
When psa_status_t is defined inside crypto_types.h, then all
users of psa_status_t are forced to pull the full range of PSA
Crypto API type definitions.

This however means that psa_status_t cannot be used when defining
those PSA Crypto API types, since doing so would create a cycle.

Fix this by moving the PSA status definitions into a separate header
file which additionally is compatible with the PSA Status code API.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
2024-09-07 12:12:19 +02:00
Benjamin Valentin
6177380762 event_periodic_callback: add assertion that event has a handler 2024-08-29 17:20:16 +02:00
Benjamin Valentin
10f28b873e sys/event_callback: add event_callback_post() 2024-08-29 17:19:43 +02:00
xnumad
48a2417892 gnrc/ipv6: nib route: hide off-link PLEs 2024-08-26 16:30:58 +02:00
benpicco
1626919da7
Merge pull request #20684 from fabian18/pr/fix_gcoap_observe_response_correlation
sys/net/application_layer/gcoap: fix Observe notifications correlation
2024-08-26 14:11:59 +00:00
benpicco
73581fa56e
Merge pull request #20784 from ML-PA-Consulting-GmbH/dl/riot/20240715__nib__static_ll_addr_excludes
nib.c: add interface selection rules for static link local address assignment
2024-08-26 09:59:44 +00:00
Daniel Lockau
7240d37fc2 nib.c: allow selection of interfaces for static link local addresses 2024-08-26 08:31:21 +02:00
Fabian Hüßler
a181c7b543 sys/gcoap: add public function to find a resource by path 2024-08-21 17:49:48 +02:00
Fabian Hüßler
c1535d25ba nanocoap: constify coap_match_path() API 2024-08-21 17:49:48 +02:00
Fabian Hüßler
08f6ec49c4 gcoap: lock CoAP state mutex in observe API 2024-08-21 17:49:48 +02:00
Fabian Hüßler
a2a7f41a59 gcoap: send Observe notifications from request address 2024-08-21 17:34:18 +02:00
chrysn
a26366371d sys/ztimer: Remove the deprecated ztimer_now64
This has been scheduled for removal after 2022.10, and its replacement
ztimer64_now has long been available.
2024-08-20 20:52:37 +02:00
Benjamin Valentin
2aaaf6df9e net/gcoap: fix guards around defines 2024-07-29 19:04:15 +02:00
mguetschow
9ca96967c0
Merge pull request #20698 from netd-tud/sha3_implementation
sys/psa_crypto: sha3 support
2024-07-15 10:32:17 +00:00
Martine Lenders
53d853342f
doc: fix links to GNRC master thesis 2024-07-15 11:25:30 +02:00
Wunderbaeumchen
9b502027ab sys/psa_crypto: added sha3 glue code 2024-07-13 04:35:21 +02:00
benpicco
4ba7c46e4d
Merge pull request #20711 from fabian18/pr/gcoap_aux_local_in_req_send
gcoap: propagate local tx aux to gcoap_req_send() and in _handler_req()
2024-07-05 12:07:38 +00:00
Marian Buschsieweke
6a3d689238
sys/xtimer: add IWYU pragmas
This include what you use (IWYU) pragmas so that clang based linters
(such as clangd) treat the use of `xtimer_...()` functions as a use
of the `xtimer.h` header, even if the implementation of those functions
come from a compatibility wrapper.
2024-06-07 12:05:43 +02:00
mguetschow
f2c18b0b58
Merge pull request #20718 from LP-HAW/fix-sha2prng-init
sys/random: fix SHAxPRNG init_by_array
2024-06-03 09:27:00 +00:00
LP-HAW
9cf9638fdc sys/random: fix SHAxPRNG init_by_array 2024-05-31 23:29:09 +02:00
Fabian Hüßler
c12375eec4 gcoap/forward_proxy: reply from request destination address 2024-05-31 12:04:48 +02:00
Fabian Hüßler
f4b1306460 gcoap: pass aux local to _handle_req() 2024-05-31 12:04:48 +02:00
Fabian Hüßler
40fb250ae4 treewide: adapt to gcoap_req_send aux local API change 2024-05-31 12:04:48 +02:00