Skip to content

Commit

Permalink
Break linkability on client-side after planned migration
Browse files Browse the repository at this point in the history
The server switches to a new CID as well, but it sends a
path-challenge on the old path with the new CID.  So it is still
possible to trace back the connection to the old path after the client
switches to a new socket.
  • Loading branch information
nemethf committed Apr 2, 2024
1 parent 4822fd4 commit c2ac17e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@ impl Connection {
}

/// Switch to a previously unused remote connection ID, if possible
fn update_rem_cid(&mut self) {
pub fn update_rem_cid(&mut self) {
let (reset_token, retired) = match self.rem_cids.next() {
Some(x) => x,
None => return,
Expand Down
3 changes: 3 additions & 0 deletions quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,9 @@ impl State {
) -> Result<(), ConnectionError> {
loop {
match self.conn_events.poll_recv(cx) {
Poll::Ready(Some(ConnectionEvent::UpdateRemoteConnectionId)) => {
self.inner.update_rem_cid();
}
Poll::Ready(Some(ConnectionEvent::Ping)) => {
self.inner.ping();
}
Expand Down
1 change: 1 addition & 0 deletions quinn/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ impl Endpoint {
// Generate some activity so peers notice the rebind
for sender in inner.connections.senders.values() {
// Ignoring errors from dropped connections
let _ = sender.send(ConnectionEvent::UpdateRemoteConnectionId);
let _ = sender.send(ConnectionEvent::Ping);
}

Expand Down
1 change: 1 addition & 0 deletions quinn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ enum ConnectionEvent {
},
Proto(proto::ConnectionEvent),
Ping,
UpdateRemoteConnectionId,
}

#[derive(Debug)]
Expand Down

0 comments on commit c2ac17e

Please sign in to comment.