Skip to content

fix(proto): track the key update boundary per path - #869

Merged
flub merged 3 commits into
n0-computer:mainfrom
PythonShe:fix/per-path-key-update-end
Nov 12, 2026
Merged

flub merged 3 commits into
n0-computer:mainfrom
PythonShe:fix/per-path-key-update-end

Conversation

@PythonShe

Copy link
Copy Markdown
Contributor

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

  • Self-review.
  • Tests if relevant.
  • cargo make passes locally.

@n0bot n0bot Bot added this to iroh Oct 27, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Oct 27, 2026

@flub flub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks very nice generally, just a few minor thing that would be nice if you could adjust them.

And apologies for taking a while to get to reviewing this.

@flub

flub commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

no need to worry about cargo-deny. we'll fix this in another pr if merging main doesn't help

@flub flub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@flub
flub added this pull request to the merge queue Nov 12, 2026
Merged via the queue into n0-computer:main with commit bb9a5ed Nov 12, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Nov 12, 2026
@PythonShe
PythonShe deleted the fix/per-path-key-update-end branch November 14, 2026 21:48
emrul added a commit to GetAster/noq that referenced this pull request Nov 24, 2026
* upstream/main: (24 commits)
  refactor(proto): call the std-only float math through crate-root helpers (n0-computer#848)
  refactor(proto): Avoid PathId allocation when building PATH_ACKS (n0-computer#901)
  chore: Release
  chore(deps): fix unused crates warnings of rust 1.100 (n0-computer#899)
  chore: Update issue template checkboxes (n0-computer#897)
  chore: humantime is unmaintained (n0-computer#900)
  chore(ci): fix workflows for test binaries locations (n0-computer#896)
  fix(perf): don't enable qlog feature in perf binary (n0-computer#850)
  fix(proto): track the key update boundary per path (n0-computer#869)
  tests: additional stream affinity tests (n0-computer#890)
  feat: allow streams to set an affinity for a path, simple version (n0-computer#881)
  fix(udp): handle receive errors before truncation flags in recv_single (n0-computer#884)
  chore: Upgrade async-executor and allow warnings in patchbay build (n0-computer#888)
  chore: Use shared minimal-crates worksflow (n0-computer#862)
  tests: Increase local slow-tests timeout (n0-computer#860)
  fix(proto): keep unread data when compacting an unordered stream (n0-computer#867)
  fix(proto): coalesce contiguous chunks during defragment (n0-computer#866)
  deps: Bump tokio for RUSTSEC-2026-0386 (n0-computer#868)
  feat(proto): Implement `noq_proto::SendStream::set_affinity` (n0-computer#836)
  fix(ci): bump deps for illumos (n0-computer#856)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

For key rotation the highest packet number of the old crypto keys should be tracked per-path

2 participants