From daf9fbae4b835b265e757607ca620fc48b0b3092 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 9 Oct 2026 18:16:41 +0200 Subject: [PATCH] [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). --- client/internal/pqkem/manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/internal/pqkem/manager.go b/client/internal/pqkem/manager.go index 76a1a54c4..76efa9f32 100644 --- a/client/internal/pqkem/manager.go +++ b/client/internal/pqkem/manager.go @@ -323,6 +323,10 @@ func (m *Manager) Stop() { // initiator. It is idempotent for an in-flight bootstrap: a repeat call returns the // 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 // 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),