[client] pqkem: drop the unused exchangeCtl.pendingPSK field

The responder wrote pendingPSK but nothing ever read it: the derived key is
consumed via m.psks (set at the same time) and the cached answer via lastSent.
Remove the field and its write to avoid a misleading store.

Found in cubic review on #7098 (client/internal/pqkem/manager.go:90).
This commit is contained in:
riccardom
2026-10-09 09:49:59 +02:00
parent 4eba98d561
commit 6e0c150fc9
2 changed files with 10 additions and 13 deletions
-1
View File
@@ -159,7 +159,6 @@ func (m *Manager) processOffer(remoteID RemoteID, o *OfferMsg, via string) ([]by
}
ex.state = stateAwaitingAck
ex.lastSent = raw
ex.pendingPSK = psk
gen := ex.gen
m.psks[remoteID] = psk
m.capable[remoteID] = true // a real KEM offer proves the peer runs the exchange
+10 -12
View File
@@ -76,19 +76,17 @@ const (
// exchangeCtl holds all state for one in-flight exchange with a peer, under the
// Manager's single lock. state drives every decision. lastSent is the current
// data-path retransmit payload (the offer, for the initiator). initiator is the
// ephemeral handle used at Finish; pendingPSK is the responder's derived key.
// viaSignal records that the offer went to the host for the signalling channel, so
// the loop does not retransmit it on the data path. Only the initiator runs a
// retransmit loop, so only it sets cancel.
// ephemeral handle used at Finish. viaSignal records that the offer went to the host
// for the signalling channel, so the loop does not retransmit it on the data path.
// Only the initiator runs a retransmit loop, so only it sets cancel.
type exchangeCtl struct {
id ExchangeID
state exchangeState
gen uint64 // local, per-peer monotonic generation; lets the host reject a stale PSK apply
cancel context.CancelFunc
lastSent []byte
initiator *Initiator
pendingPSK PSK
viaSignal bool
id ExchangeID
state exchangeState
gen uint64 // local, per-peer monotonic generation; lets the host reject a stale PSK apply
cancel context.CancelFunc
lastSent []byte
initiator *Initiator
viaSignal bool
}
// Manager is the stateful orchestrator — the analogue of go-rosenpass's Server. It