diff --git a/DESIGN.md b/DESIGN.md index 68e5c18..657bb66 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -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 diff --git a/PROTOCOL.md b/PROTOCOL.md index 01870fa..eb31059 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -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 diff --git a/internal/transport/renew_test.go b/internal/transport/renew_test.go index 58d066a..10adbb9 100644 --- a/internal/transport/renew_test.go +++ b/internal/transport/renew_test.go @@ -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. diff --git a/third_party/tailcat/quantumcat.go b/third_party/tailcat/quantumcat.go index 5e7cad7..ebeef28 100644 --- a/third_party/tailcat/quantumcat.go +++ b/third_party/tailcat/quantumcat.go @@ -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()