[client] pqkem: document SignalOffer's error-marker return contract

SignalOffer now returns a non-empty error marker together with a non-nil error
when the offer build fails; the host must still send that payload rather than
dropping it, or an empty MlkemPayload would be read as the non-capable signal.
State this in the doc comment.

Found in cubic review on #7098 (client/internal/pqkem/manager.go:366).
This commit is contained in:
riccardom
2026-10-09 18:16:41 +02:00
parent de70516045
commit daf9fbae4b
+4
View File
@@ -323,6 +323,10 @@ func (m *Manager) Stop() {
// initiator. It is idempotent for an in-flight bootstrap: a repeat call returns the // initiator. It is idempotent for an in-flight bootstrap: a repeat call returns the
// same offer rather than starting a new exchange. // same offer rather than starting a new exchange.
// //
// On a build failure it returns a non-nil error AND a non-empty error-marker payload:
// the host must still send that payload, because an empty MlkemPayload is the "peer does
// not run the KEM" capability signal, which would wrongly mark this peer non-capable.
//
// A signal re-negotiation always re-bootstraps (fresh exchange): the remote may have // A signal re-negotiation always re-bootstraps (fresh exchange): the remote may have
// restarted and lost its PSK, so reusing a locally frozen one would desync. The derived // restarted and lost its PSK, so reusing a locally frozen one would desync. The derived
// PSK still survives idle in the manager (dropped only on account-level peer removal), // PSK still survives idle in the manager (dropped only on account-level peer removal),