4 Commits
Author SHA1 Message Date
proitlab 2e2b0910a8 pqconly: enforce PQ peers, including on the config-serve path
build.yml / build_ubuntu (push) Canceled after 0s
build.yml / build_macos (push) Canceled after 0s
build.yml / build_windows (push) Canceled after 0s
Lint / clang-format (push) Canceled after 0s
validate.yml / build_ubuntu (push) Canceled after 0s
`pqconly` selected a type-1 identity and then behaved exactly like
`hybrid` at runtime: every handshake gate tested only
`pqcMode() != CLASSIC`, so nothing distinguished the two modes and no
non-capable peer was ever refused. Measured on the two-host lab, a
`pqconly` node carried traffic with a fully classical peer at 0% loss.

Add `Peer::pqconlyPeerRejected()` - true when this node is exactly
`pqconly`, the peer did not advertise the HELLO capability bit, and its
role is not PLANET/MOON (all four Earth roots are `pqcCapable:false` and
enforcing against them would cut the node off the root topology).

Three verbs are gated, and the third is load-bearing. The first
implementation gated only `VERB_NETWORK_CONFIG` and
`VERB_NETWORK_CREDENTIALS` and still let the classical peer join at 0%
loss, because membership is granted by the *serve* direction: a classic
peer asks the pqconly node's controller for its config, and the node
enforcing the policy was the one handing it over. Gating
`VERB_NETWORK_CONFIG_REQUEST` before the controller is consulted closes
it. The rejection counter had been incrementing in the unrelated
direction throughout, which is what made the false assurance possible.

`hybrid` keeps its silent classical fallback - that is its contract - but
now logs a downgrade WARNING once per peer, re-armed on recovery, so a
downgraded link is no longer invisible.

The gate keys on `_hybridCapable`, not `hybridSessionKeyInstalled()`:
the encapsulating peer stages its hybrid key until the confirm tag
arrives, so gating on the installed key would reject a healthy PQ peer
for the entire staging window.

Measured 2026-10-08, two-host lab, clean rebuild, selftest exit 0:
- `pqconly` vs classical: network now sits at REQUESTING_CONFIGURATION
  with assignedAddresses [] and 100% loss, down from OK at 0% loss.
- `pqconly` vs `pqconly`: 0% loss both directions, no false rejection.
2026-10-08 10:33:12 +00:00
proitlabandClaude Opus 4.8 a224dbbc53 PQ: fix membership for post-quantum nodes (three control-plane defects)
validate.yml / build_ubuntu (push) Canceled after 0s
build.yml / build_ubuntu (push) Canceled after 0s
build.yml / build_macos (push) Canceled after 0s
build.yml / build_windows (push) Canceled after 0s
Lint / clang-format (push) Canceled after 0s
A PQ node could complete the hybrid handshake and still never join the
network: status ACCESS_DENIED, peers [], frames dropped. Three separate
defects, none in the key exchange itself.

1. EmbeddedNetworkController::_request gated known members with
   Identity(haveIdStr) != identity. HELLO carries only the classic
   projection (Identity::serializeClassic), so peer->identity() stays
   type 0 while a stored record is type 1, and operator== -- which
   compares PQ material -- always reported a mismatch. Use the existing
   sameClassicalIdentity(); PQ key rotation stays detectable via
   VERB_PQ_KEYS.

2. Peer::setPQPublicKeys() cached the received PQ keys for the crypto
   path only and never wrote them into _id. The controller's identity
   therefore stayed type 0 in every table, com.verify() returned 1, and
   Membership deferred for WHOIS forever -- a WHOIS cannot help, the
   keys arrive in VERB_PQ_KEYS. Add Identity::attachPQPublicKeys() and
   call it so the peer's Identity is complete once keys arrive.

3. OneServiceImpl::run constructed an EmbeddedNetworkController
   unconditionally, so a member-only node answered its own
   NETWORK_CONFIG_REQUESTs and self-signed a local config, never
   contacting the node that owned the network. Add
   settings.disableController (default false, so existing installs are
   unchanged) for member-only nodes.

Verified live on two hosts with pqcMode: hybrid on both sides: status OK,
peer DIRECT over 192.168.122.85/9993, pqcCapable and pqcHybridActive true
both directions, ping 0% loss both ways, selftest exit 0.

The selftest regression covers the controller match and keeps rejecting an
impostor identity at the same address.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-07 21:37:05 +00:00
dedysutanto 86c744897b feat(pqc): identity/COM v2, pqcMode config, selftest gates
Phases 3-6 (SPEC T19-T23): type-1 identity carries ML-KEM-768 + ML-DSA-65 pubs, COM type-2 double-sign, HELLO capability bit, local.conf settings.pqcMode (off/hybrid/pqconly) with classic fallback. selftest KAT + interop matrix + fragment-loss benchmark green.
2026-10-01 15:55:09 +07:00
dsutanto dbdc5bcc4a First Commit
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled
2025-11-19 16:23:45 +07:00