pqkem: strict (fail-closed) mode + wire status Quantum resistance

Strict mode (NB_PQ_MLKEM_STRICT, default off) closes the initial PQ-vulnerable
window (NET-1408): when enabled, conn.presharedKey programs a per-conn random
sentinel PSK until the ML-KEM exchange derives the real one, so no session can form
on a non-PQ key (the real PSK is pushed via SetPresharedKey once it converges).
Default stays opportunistic.

Also surface PQ status: the peer 'Quantum resistance' flag (RosenpassEnabled) is now
true when an ML-KEM PSK has been derived for the peer, not only for Rosenpass.
This commit is contained in:
riccardom
2026-09-11 14:48:54 +02:00
parent b1b2cc14c1
commit f322be1944
3 changed files with 64 additions and 2 deletions
+1
View File
@@ -2012,6 +2012,7 @@ func (e *Engine) createPeerConn(pubKey string, allowedIPs []netip.Prefix, agentV
}
if e.pqkemManager != nil {
config.PQ = pqHandshaker{mgr: e.pqkemManager}
config.PQStrict = pqkem.Strict()
}
serviceDependencies := peer.ServiceDependencies{