Commit Graph
20 Commits
Author SHA1 Message Date
Adrien Beraud 51324683e8 tests: cover forged parts in encrypted fragmented messages
Value data fragments carry no node ID. Parts of a message received in
envelopes must all come under the sender key of the envelopes, so that
plaintext or foreign-key parts spoofed from the sender's address, which
would otherwise be merged first, are ignored.
2026-10-29 23:28:48 -04:00
Adrien Beraud 32709230c6 tests: cover session cache hijacking by unvalidated senders
Replies to Initial and Hello envelopes must not cache a session at the
source address, which can be spoofed, and the cache must evict the least
recently used session rather than the lowest address. A node that started
with an Initial envelope only switches to Data envelopes once the peer
answered a Session envelope, which is when the peer caches the session.
2026-10-29 23:28:48 -04:00
Adrien Beraud d23cb42b27 tests: cover a peer restarting with the same key
A node restarting with the same key and contacting a peer by address gets answers encrypted with the ephemeral key of its previous run.
2026-10-29 23:28:48 -04:00
Adrien Beraud 40560eec4e tests: cover keyless Data envelopes and session confirmation
Steady-state traffic uses Data envelopes, without sender keys nor credential, once the peer answered a request. Data envelopes only open from the session address, also authorize writes, and survive the receiver's epoch rotation.
2026-10-29 23:28:48 -04:00
Adrien Beraud dfb66c5a23 tests: cover session-based write authorization and address-bound keys
Encrypted writes must come in a Session envelope, whose ephemeral key is bound to the sender address. Plaintext writes still need a token, now issued by the network engine.
2026-10-29 23:28:48 -04:00
Adrien Beraud 791a667fe2 tests: cover ephemeral key rotation, peer restart and hello
The previous ephemeral key is accepted for one more period, then erased.
A request retry restarts with an Initial envelope and our credential.
A hello is only answered and doesn't change what is known of its sender.
2026-10-29 23:28:48 -04:00
Adrien Beraud 68b5996ba9 tests: cover encrypted transport and private networks 2026-10-29 23:28:48 -04:00
Adrien Beraud 0d120eb5d4 tests: cover projected query request scheduling 2026-10-26 09:21:10 -04:00
Adrien Beraud dddd97daff tests: cover partial reply hardening 2026-08-05 14:29:03 -04:00
Cyrille BéraudandCopilot 0826822a4d net: harden fragmented message reassembly
Key partial messages by source and transaction ID, buffer bounded fragments received before their header, and avoid charging reordered requests twice against rate limits. Cover source collisions, early fragments, empty data and large values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-05 14:29:03 -04:00
Adrien Béraud ccd4865df5 dht: allow search table update with listen token refresh 2026-03-14 16:17:32 -04:00
Adrien Béraud 964800a506 tests: disable test_networkengine on MSVC 2026-03-13 16:30:36 -04:00
Adrien Béraud 4f423d066f tests: attempt to fix test_networkengine on MSVC 2026-03-13 16:09:49 -04:00
Adrien Béraud ae49b96c2d tests: attempt to fix test_networkengine on MSVC 2026-03-13 16:02:33 -04:00
Adrien Béraud 3701b21425 tests: attempt to fix test_networkengine on MSVC 2026-03-13 15:49:52 -04:00
Adrien Béraud bef4e61fc6 tests: add test for update of listen token 2026-03-13 15:10:12 -04:00
Adrien Béraud 4a43326de1 tests: add more proxy tests 2026-03-13 13:06:36 -04:00
Adrien Béraud c37ff1b167 tests: add test for reopens socket after node expiration 2026-03-13 11:06:30 -04:00
Adrien Béraud f94f072ad6 dht: send token in listen confirmation 2026-03-13 00:53:05 -04:00
Adrien Béraud 931d79b701 dht: handle out-of-order partial messages 2026-03-08 12:26:23 -04:00