Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,16 @@ Because the ML-KEM client private key is freshly generated for the connection an
Each renewal generates another independent ephemeral ML-KEM key. If an attacker
captures normal process memory and current session keys, then loses access
before a later renewal begins, the fresh ML-KEM shared secret makes the renewed
PSK independent of the captured state. After one successful uncompromised
renewal, that earlier snapshot is insufficient to follow the session. This
property does not require a persistent root or server-side ratchet state.
PSK independent of the captured state. On success, `Renew` has installed the
fresh PSK and requested a WireGuard handshake. The first outbound application
packet after return can still use an existing send key. A delayed or lost
handshake can extend that period.

For each direction, the earlier snapshot ceases to reveal traffic encrypted
with keys derived from the fresh PSK. WireGuard may continue to accept packets
under an older receive key during the transition. The API reports neither the
active traffic-key generation nor when old receive keys retire. A later
handshake timestamp or a successful probe cannot establish either event.

This is recovery from an ended snapshot or offline compromise, not protection
from continuing endpoint control. An attacker that remains able to execute in
Expand Down
16 changes: 10 additions & 6 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ for the same source (and erases their key material). A second installation for
that source cannot begin while the first is outstanding. Only the surviving
committed transcript may resend its cached acknowledgement.

The server updates the peer's PSK in place before acknowledging; the client
updates its PSK after the authenticated acknowledgement and schedules a fresh
WireGuard handshake on the next user packet. Existing WireGuard traffic keys
are retained through the transition. Node addresses, routes, netstack and TCP/
UDP sockets are not recreated. Failed client attempts retry after five seconds;
there is no process-lifetime deadline. Both endpoints require renewal support.
The server updates the peer's PSK in place before acknowledging. After the
authenticated acknowledgement, the client installs the fresh PSK and requests
a WireGuard handshake on outbound traffic. `Renew` returns at that point.
Immediate traffic can still use an existing send key, and a delayed or lost
handshake can extend its use. Old receive keys may remain valid after a new
send key is active. See DESIGN §22.6 for the recovery guarantee.

The existing node addresses, routes, netstack, and TCP/UDP sockets survive
renewal. Failed client attempts retry after five seconds with no process-lifetime
deadline. Both endpoints require renewal support.

## Swift helper

Expand Down
2 changes: 1 addition & 1 deletion internal/transport/renew_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func TestTCPStreamSurvivesRenewalAndLostAcknowledgement(t *testing.T) {
newHandshake = peer.LastHandshake.After(initialHandshake)
}
if !newHandshake {
t.Fatal("renewed PSK never completed a fresh WireGuard handshake")
t.Fatal("no later WireGuard handshake observed")
}

// An existing node cannot be taken over by a different authenticated identity.
Expand Down
5 changes: 4 additions & 1 deletion third_party/tailcat/quantumcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ type AuthenticatedPeer struct {
}

// Renew repeats authentication without recreating the device, netstack, node
// address, or sockets. Existing WireGuard traffic keys survive the PSK update.
// address, or sockets. On success, the client has installed the fresh PSK and
// requested a WireGuard handshake. Traffic can still use existing keys after
// return. A handshake timestamp or successful Probe cannot identify which PSK
// supplied the active traffic keys.
func (c *Client) Renew(ctx context.Context) error {
c.renewMu.Lock()
defer c.renewMu.Unlock()
Expand Down
Loading