mirror of
https://github.com/n0-computer/noq.git
synced 2026-11-15 21:09:07 +00:00
bb9a5edca1
Fixes #864 ## Description `PrevCrypto` now records, for each path, the first packet received under the new keys. A packet decrypts with the previous keys until its own path has seen one. `end_packet` is split into `end_time` (still used by the discard timer) and `end_packets`. Adds `key_update_keeps_late_old_key_packets_on_another_path`, which fails on main. ## Notes A path with no new-key packet yet keeps using the previous keys, so a further key update the peer started on such a path before we drop the old keys would fail to decrypt. RFC 9001 §6.5 has the peer wait three PTOs after its previous update is acknowledged, and accepts that packets may be discarded if it doesn't. ## Change checklist - [x] Self-review. - [x] Tests if relevant. - [x] `cargo make` passes locally.