`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.
24 KiB
24 KiB
SPEC — BackOne
§G (goal)
Make BackOne quantum ready: phases 1-6 of backone-quantum-fork-research.md — liboqs + hybrid X25519+ML-KEM-768 / Ed25519+ML-DSA-65 handshake, identity/COM v2 double-sign, capability-bit negotiation. Phase 7 (AES-256-GCM) OUT.
§C (constraints)
- C++17. GNU make = real build. Top
CMakeLists.txt= stub, never product build. - Deps vendored in
ext/. No new dep for few-liners. - Tabs always,
.clang-formatLLVM/Stroustrup, indent 4. No reformat of untouched lines. - New
.cpp/.hpp/.hgets 11-line BSL header verbatim (node/Mutex.hpp:1-12). node/stays OS-independent. Sockets/files →osdep/. Orchestration →service/. Persistence →controller/.- No exceptions across C API. Fatal
ZT_ResultCode= 100–999. - One reactor thread (
Phy::poll). Cross-thread wake onlyPhy::whack(). - New compiled file → register in
objects.mkor no link. - Platforms: Linux (primary), macOS, BSD/NetBSD, Windows (msbuild).
- Header edits: no
-MMDdep tracking →make cleanafter touching.h. - PQC lock: liboqs static vendored
ext/; hybrid key = KDF(classical ‖ pq); presetshybrid(ML-KEM-768/ML-DSA-65) +pqconly(same parameter set ashybrid— not distinct, see T25) pqconlyenforces a PQ-capable peer on member traffic;hybridonly prefers it. Both use the same ML-KEM-768/ML-DSA-65 material (V20, T25)- wire/identity/COM use versioned v2 + capability-bit fallback to classic
include/ZeroTierOne.hchanges additive-only (Java/libzt ripple)- OUT: AES-256-GCM swap, trusted-path skipCrypto, forward secrecy, protocol standardization, crypto audit, production release/signing
?address v2 derivation keeping 40-bit + PoW?VL1 fragmentation capacity for +4KB identity (checknode/Packet.*)?liboqs version/tag + build flags forext/?measured ML-KEM/ML-DSA latency (doc estimates unverified)?capability-bit placement in existing handshake
§I (public surfaces)
| id | surface | detail |
|---|---|---|
| I.capi | C API | include/ZeroTierOne.h, ZT_Node_* (lines 1796-2258), ZT_SDK_API. Ripples to Java/libzt/SDK |
| I.api | HTTP JSON API | 127.0.0.1:9993, /status /peer /network /member /controller /metrics /info, auth X-ZT1-Auth header or ?auth= from authtoken.secret |
| I.cli | CLI | backone-cli info|listpeers|listnetworks|join|leave (-j -p -D), backone-idtool generate|validate|getpublic|sign|verify|mkcom — symlink dispatch on argv[0] |
| I.cfg | config | home /var/lib/backone (macOS /Library/Application Support/BackOne), local.conf, identity.secret, networks.d/, controller.db, backone.port, backone.pid |
| I.build | build | make, make one, make selftest, make core, make debug, make install, make debian/redhat, make central-controller; env ZT_* knobs |
| I.ffi | Rust FFI | rustybits/zeroidc (zeroidc_new…), smeeclient — C header zeroidc.h, link on ZT_SSO_SUPPORTED=1/ZT_CONTROLLER=1 |
| I.jni | Java SDK | java/jni/…Node.cpp, ant targets build_java/build_android/build_jar |
| I.pqc.cfg | config | local.conf settings.pqcMode (off/hybrid/pqconly); absent = off/classic (opt-in), unknown value = warn + classic. hybrid prefers PQ and silently falls back; pqconly refuses config/credentials from non-capable non-root peers (V20) — a policy mode, not just an identity selector. Per-algorithm kem/sig selection is not wired (research doc only, see T25) |
| I.pqc.wire | wire | static-static hybrid, no ephemeral exchange: identity v2 (type byte 1) stores ML-KEM-768 + ML-DSA-65 pub on disk, but HELLO carries only the classic projection (Identity::serializeClassic) so vanilla peers parse it; peer PQ keys arrive in VERB_PQ_KEYS (0x17); agree = KDF(X25519-identity-agree ‖ ML-KEM-encaps(peer static pub)); the agreed key is confirmed by a trailing 4 B tag in the same verb (optional, V19), since ML-KEM cannot report a mismatched decapsulation; capability via HELLO protocol-version high bit; identity.secret/identity.public v2 on disk |
| I.pqc.com | credentials | COM double-sign/verify — controller + node/CertificateOfMembership.* |
| I.rules | rules compiler | node rule-compiler/cli.js <rules> → rules/tags JSON |
§V (invariants)
Derived from selftest.cpp + CI gates. ? = code-derived, no test yet.
| id | invariant | evidence |
|---|---|---|
| V1 | Crypto KATs pass: Salsa20 vectors, C25519 agreement, Ed25519 sign/verify, SHA512, Poly1305 | selftest.cpp:137 testCrypto |
| V2 | Identity known-good accepted, known-bad rejected | selftest.cpp:475 testIdentity |
| V3 | CertificateOfMembership signs and agreesWith roundtrip |
selftest.cpp:577 testCertificate |
| V4 | Packet encode/decode roundtrip exact | selftest.cpp:641 testPacket |
| V5 | Phy UDP+TCP loopback on 127.0.0.1 works, no root | selftest.cpp:1002 testPhy |
| V6 | Zero definite leaks under valgrind; test exit code 0 | .github/workflows/validate-report.sh |
| V7 | ? No exception crosses C API; ZT_ResultCode_isFatal only 100–999 |
include/ZeroTierOne.h:426 |
| V8 | ? node/ contains no OS calls (sockets/files/interfaces) |
node/README.md rule |
| V9 | hybrid↔vanilla negotiates classic, link stays up | interop matrix |
| V10 | identity v2 survives 1280B MTU tunnel intact; v2 = type byte 1 (wire Identity.hpp:219, string slot Identity.cpp:173); address derivation hashes X25519 material only → v1/v2 addresses bit-identical; v1 parser rejects type ≠ 0 cleanly |
interop matrix |
| V11 | ML-KEM/ML-DSA KATs + hybrid KDF vector + identity v2 roundtrip + COM double-sign verify pass | extended selftest.cpp |
| V12 | pqcMode negotiation honors local.conf (off -> no v2 fields) |
live daemon: bogus settings.pqcMode -> WARNING (service/OneService.cpp:1478), hybrid -> clean (2026-10-03); selftest has no pqcMode coverage |
| V13 | hybrid agree = KDF(X25519-identity-agree ‖ ML-KEM static-static), no ephemeral exchange; hybrid↔hybrid agree + hybrid↔vanilla classic fallback pass | node/Peer.cpp ensurePendingHybridCt (encaps) / setHybridSessionKey (install); node/IncomingPacket.cpp _doPQ_KEYS (parse + decaps) |
| V14 | COM double-sign = type byte 1→2 appends ML-DSA sig alongside Ed25519; v1 verify path unchanged; v1 rejects type 2 cleanly | node/CertificateOfMembership.hpp:222-296, node/CertificateOfMembership.cpp:97-162, selftest.cpp:717 |
| V15 | handshake vs fragment loss measured: classic HELLO stays 137 B → 1 frag in every mode (max 7 Packet.hpp:235); PQ material moved off the critical path, so HELLO no longer depends on fragment reassembly |
selftest.cpp PQ section |
| V16 | hybrid handshake puts a 1088 B ML-KEM-768 ct on the wire and both sides derive the same hybrid _key; classic/off peers never receive VERB_PQ_KEYS and fall back |
see V17 for the live evidence |
| V17 | PQ public keys travel out of band in VERB_PQ_KEYS (0x17), never inside HELLO: HELLO carries only Identity::serializeClassic so a vanilla peer can parse it, and VERB_PQ_KEYS (4253 B → 3 frags) carries ML-KEM-768 + ML-DSA-65 public keys plus, from the lowest address, the 1088 B ct. Flag byte: bit0 = ct present, bit1 = "I already hold your keys" (ends the retry loop). A 4 B key-confirmation tag follows the keys (after the ct when present), see V19. |
2-node moon lab: pqcCapable:true, pqcHybridActive:true, 3 active direct paths at 172.31.0.1/19993 (2026-10-06) |
| V18 | FLAGS is inside the AES-GMAC-SIV AAD and dearmor keeps the FRAGMENTED bit, so setFragmented(true) must precede armor(); Switch::_sendViaSpecificPath may not set it on an already-armored packet. dearmor decrypts to scratch and commits only on success, so a failed attempt does not destroy the ciphertext a later key would need. |
selftest.cpp PQ section: fragmented pre-armed packet dearmors, late-set flag does not (verified FAIL-AS-EXPECTED) |
| V19 | The hybrid session key is confirmed, never merely assumed. ML-KEM uses implicit rejection: decapsulating with a secret that does not match the peer's public key returns a well-formed but wrong shared secret instead of an error, so a peer whose PQ material drifted derived a different key, believed agreement succeeded, and every data frame then failed its MAC — with _pqKeysAcked already latched at the first handshake, so the retry timer never fired again and only a one-sided daemon restart recovered. A 4 B tag = HMAC-SHA384(_key, peer_address), under its own KBKDF label (ZT_KBKDF_LABEL_PQ_CONFIRM '2') so it cannot collide with session-key material, rides at the end of VERB_PQ_KEYS and is optional on the wire (a build without it still interoperates). Mismatch → resetPQExchange(), which reverts _key to classical, so the inbound path's hybrid-then-classical fallback (IncomingPacket.cpp) keeps working throughout. A peer that rolled its PQ keys still holds ours and therefore sets the ack bit in the very message where the rotation is detected, so that ack is dropped for that exchange — honouring it would re-latch the state just cleared and suppress the reply that carries the fresh ciphertext. |
selftest.cpp "Key confirmation detects mismatched hybrid key"; direct test against libbackonecore.a: honest session confirms, mismatched derivation is caught, renegotiation converges to agreeing keys. Live 2-node hybrid session (n2 joins n1's network) produced zero confirmation failures, so healthy sessions are not reset |
| V20 | pqconly is a policy mode, not an identity selector. Under pqconly a non-capable non-root peer is refused VERB_NETWORK_CONFIG, VERB_NETWORK_CREDENTIALS and VERB_NETWORK_CONFIG_REQUEST, so no network comes up over a silently classical link and no COM establishes trust across one; PLANET/MOON roles are exempt because all four Earth roots report pqcCapable:false and enforcing against them would cut the node off from the root topology. The third verb is load-bearing and was measured, not assumed: gating only the two receive-side verbs left a classical peer able to join, because membership is granted by the serve direction — the classic peer asks the pqconly node's controller for its config and the node enforcing the policy was the one handing it over (0% loss, network OK, counter incrementing in the unrelated direction). The gate keys on _hybridCapable (fixed at HELLO), not hybridSessionKeyInstalled(), because the encapsulating peer stages its hybrid key until the confirm tag arrives and would otherwise be rejected for the whole staging window. hybrid keeps the silent classical fallback but now logs a downgrade WARNING once per peer (re-armed on recovery), so a downgraded link is no longer invisible. |
docs/pqconly-mode-test.md §4a records the hole and the fix; measured 2026-10-08 on the two-host lab: before this change a pqconly node held 3 paths to a fully classical peer at 0% loss; after it the classical peer sits at REQUESTING_CONFIGURATION with assignedAddresses:[] and 100% loss, while two pqconly nodes hold 0% loss in both directions with no false rejection. Refusals are countable via pkt_network_config_in_pqconly_rejected / pkt_network_credentials_in_pqconly_rejected |
§T (tasks)
| id | status | task | cites |
|---|---|---|---|
| T1 | x | Fix CI build smoke: build.yml runs ./zerotier-selftest, build emits backone-selftest (also tar zerotier-one → backone) |
I.build,V6 |
| T2 | x | Fix validate-linux.sh binary names: invokes ./zerotier-one, ./zerotier-cli (lines 41-43,105,111,451), builds backone* |
I.cli,V6 |
| T3 | x | Wire ZT_COVERAGE into makefiles — consumed by none, gcovr likely reports zeros ? |
I.build |
| T4 | x | make install manpage rule: expects doc/backone.8, doc/backone-cli.1, doc/backone-idtool.1; doc/ only has zerotier-*, no rename rule |
I.build |
| T5 | x | make redhat: backone.spec %install copies missing debian/backone.service + ext/installfiles/linux/backone.init.rhel6 (actual files zerotier-*) |
I.build |
| T6 | x | Rebrand make-bsd.mk/make-netbsd.mk: still emit/install zerotier-one, /var/db/zerotier-one vs code writing backone.pid |
I.build |
| T7 | x | Dockerfile.ci: copies zerotier-one from build → fails; binary is backone |
I.build |
| T8 | . | pkg/snap/snapcraft.yaml: builds upstream github.com/zerotier/zerotierone.git, expects usr/sbin/zerotier-one |
I.build |
| T9 | . | Wire orphaned java/test/StringUtilsTest.java (JUnit4) into java/build.xml target or delete |
I.jni |
| T10 | . | Replace rule-compiler/package.json npm test failing placeholder with real test of rule-compiler.js |
I.rules |
| T11 | . | ? Add #[test] coverage for rustybits/zeroidc FFI parse/exchange paths |
I.ffi,V7 |
| T12 | x | Implement Redis config TODO (service/OneService.cpp:1467 // TODO: Redis config) |
I.cfg |
| T13 | . | Implement LFDB::eraseNetwork/eraseMember TODOs (controller/LFDB.cpp:383,388) |
I.cfg |
| T14 | . | make lint (tools/lint.sh, changed-lines clang-format) + .github/workflows/lint.yml |
I.build |
| T15 | . | Fix -Wsign-compare suppression FIXME (node/Bond.cpp:23, node/Node.cpp:40) |
I.build |
| T16 | x | Federation identity-collision payload FIXME (node/IncomingPacket.cpp:211) ? scope |
I.capi,V7 |
| T17 | x | Phase 1: vendor liboqs static into ext/, wire make-linux.mk + objects.mk, pin version/tag + flags |
I.build |
| T18 | x | Phase 2: node/PQHybrid.* hybrid agree = KDF(X25519-identity-agree ‖ ML-KEM-768 encaps over peer static pub); phase-2 ephemeral-field mockup dropped |
I.pqc.wire,V13 |
| T19 | x | Phase 3: identity v2 type byte 1, append ML-KEM+ML-DSA pubs, address hash X25519-only, v1 clean reject type ≠ 0 | I.pqc.wire,V10 |
| T20 | x | Phase 4: COM type byte 2 double-sign (Ed25519+ML-DSA-65), v1 rejects cleanly | I.pqc.com,V14 |
| T21 | . | Phase 5: local.conf settings.pqcMode parse (off/hybrid/pqconly) + capability negotiation via HELLO protocol-version bytes, fallback classic. Mode now selects whether PQ material is used; which preset is still hardcoded (T24) |
I.pqc.cfg,V12,V9 |
| T22 | x | Phase 6: selftest extension — ML-KEM/ML-DSA KATs, hybrid KDF vector, identity v2 roundtrip + address stability, COM double-sign, interop hybrid↔vanilla matrix | I.build,V11,V10,V14 |
| T23 | x | Phase 6: handshake-vs-fragment-loss benchmark for PQC HELLO; cap/segment if loss breaks handshake | V15 |
| T24 | x | Plumb settings.pqcMode through the identity path: Node(…,int pqcMode) stores _pqcMode; Identity::generate(bool pq,int pqcMode) derives pq from the daemon mode; OneService reads local.conf before new Node — a fresh hybrid/pqconly node writes a type-1 identity, a classic one type-0. Fixes the G1 defect. |
I.pqc.cfg,V12 |
| T25 | . | Distinct PQ parameter sets: node/PQHybrid.* hardcodes ML-KEM-768/ML-DSA-65 (PQHybrid.cpp static_asserts OQS_KEM_ml_kem_768/OQS_SIG_ml_dsa_65), so hybrid and pqconly select identical cryptographic material. pqconly is nonetheless behaviorally distinct — it enforces the peer requirement (V20) — but §C's "ML-KEM-1024/ML-DSA-87 for pqconly" was never implemented and has been removed. Parameterize the preset (key sizes, ct len, _pendingHybridCt buffer) only if stronger parameters are actually wanted; the HELLO MTU objection no longer applies (PQ material rides in VERB_PQ_KEYS, V17), so the only remaining coupling is the buffer sizes in Peer.hpp. |
I.pqc.wire,I.pqc.cfg,V15,V17,V20 |
| T26 | . | Expose real PQ state in /peer: pqcCapable/pqcHybridActive are copied from the ZT_Peer snapshot, which never populates them, so both always read false (B6). Add a Node accessor for a live peer by address and populate both fields in the three _peerToJson call sites. Needs a ZT_Node C API entry point, so it ripples to include/ZeroTierOne.h, java/jni, and the SDKs — budget for that rather than reaching into node/ from service/. |
I.pqc.wire,I.capi,V19 |
T1/T2 = prerequisites — CI must invoke backone-selftest before PQC gates mean anything. T1–T16 backlog (rebrand/CI/lint leftovers); T17–T25 = PQC phases 1–6 + the pqconly preset gap; T26 = PQ state is not observable via /peer.
Not tracked (low value ?): one.cpp:256 port/token cleanup, MacKextEthernetTap.cpp:480 iface status, VLAN TODOs in NetBSDEthernetTap.cpp:468/MacKextEthernetTap.cpp:685, Phy.hpp:325 unix sock type comment.
§B (bug log)
| id | date | cause | fix |
|---|---|---|---|
| B1 | 2026-10-02 | Phase 5 (T21) advertised PQC capability in HELLO but never consumed it: Peer::_key was derived classically in the constructor and the hybrid ciphertext had no place in the HELLO/OK(HELLO) layout, so hybridEligible() was dead. |
Wire hybrid static-static KEM ct into HELLO (lowest-address side writes [moon count][moons][flag(1B)][ct 1088B], crypted with the classical key) and echo it in OK(HELLO); parser order matches Peer::sendHELLO/_doHELLO; Peer::ensurePendingHybridCt() lazily encapsulates on first capability sighting so the handshake completes in one round trip; direction guard sender == lowest address on both parses. Refuse to start when the on-disk identity cannot satisfy settings.pqcMode (classic↔PQ migration changes the address). |
| B2 | 2026-10-02 | settings.pqcMode absent (or unrecognized) resolved to HYBRID, and Node's pqcMode default was HYBRID with no way to tell "unconfigured" from "configured hybrid". Every existing type-0 install would hit the B1 refusal guard at startup; the C API ZT_Node_new path would silently generate type-1 identities. |
Absent/unknown settings.pqcMode now resolves to ZT_PQC_MODE_CLASSIC (PQC is opt-in, matching the research doc); Node(…,int pqcMode = ZT_PQC_MODE_CLASSIC). Verified: classic identity + no config boots on 2.0.0 and stays 141 B; fresh node w/o config makes type-0; fresh node with "hybrid" makes type-1 (6415 B); classic + explicit "off" boots; classic + explicit "hybrid" still refuses; unknown value warns and runs classic. |
| B3 | 2026-10-06 | The hybrid handshake never completed. Three defects stacked: (a) HELLO carried the full 6415 B type-1 identity, so every peer had to reassemble a 3-fragment packet before it could even answer, and a vanilla peer could not parse it at all; (b) Switch::_sendViaSpecificPath called packet.setFragmented(...) on packets that were already armored — FLAGS is inside the AES-GMAC-SIV AAD, so flipping the bit after armor() invalidated the MAC and the receiver dropped every VERB_PQ_KEYS as "invalid MAC"; (c) Packet::dearmor decrypted in place, so a failed attempt destroyed the ciphertext a later key would need. |
PQ material moved out of HELLO into VERB_PQ_KEYS; HELLO now emits only Identity::serializeClassic. _sendViaSpecificPath sets FRAGMENTED only on unencrypted packets; sendPQKeys sets it before armor(). dearmor decrypts to a scratch buffer and commits only on success. Regression test in selftest.cpp asserts both directions (fragmented-and-pre-armed authenticates; armed-then-flagged does not), verified failing against the old ordering. |
| B4 | 2026-10-06 | Reported symptom was backone-cli peers showing a wall of PLANET -1 RELAY rows. Two things were wrong with the reading: the leading 200 is the HTTP status code that one.cpp:453 prints, not a peer count; and the rows are the four hardcoded Earth roots, which a host with no UDP egress to 9993.zerotier.com can never reach — hence RELAY and latency -1 with no path. |
No code change. Documented here so the symptom is not re-read as a PQ failure: a node that cannot reach a root shows exactly this table, independent of pqcMode. |
| B5 | 2026-10-07 | A hybrid session could wedge permanently and silently. ML-KEM uses implicit rejection: agreeHybridDecaps with a secret that does not match the peer's public key returns a well-formed but wrong shared secret rather than an error, so both sides believed agreement had succeeded and installed it. A peer whose PQ material drifted (restore from backup, identity roll) derived a different key than its counterpart, and every data frame thereafter failed its MAC. _pqKeysAcked had already latched at the first handshake, so pqKeysDue never fired again and the retry path could not repair it — recovery required restarting one daemon. Compounding it, a peer that rolled its keys still holds ours and so sets the ack bit in the very message announcing the rotation, so the ack re-latched the state being cleared and suppressed the reply that carried the fresh ciphertext. |
Added key confirmation: 4 B HMAC-SHA384(_key, peer_address) at the tail of VERB_PQ_KEYS, optional on the wire, under its own KBKDF label. Mismatch, or advertised public keys that differ from the installed ones, calls resetPQExchange() — drops the hybrid key, reverts _key to classical (the inbound hybrid-then-classical fallback keeps traffic alive throughout), re-arms the retry, and re-encapsulates. The stale ack is dropped for that exchange so the reply is not suppressed. agreeHybridDecaps failure is no longer silently ignored. Verified in selftest.cpp and directly against libbackonecore.a; live 2-node hybrid session shows zero false confirmations. |
| B6 | 2026-10-07 | Reported wrong and withdrawn. Originally logged as "pqcCapable/pqcHybridActive in /peer are copied from a ZT_Peer snapshot that never populates them, so both always report false." That was false: Node::peers() populates both at node/Node.cpp:621,626 from Peer::hybridCapable() and Peer::hybridSessionKeyInstalled(), and no C API change was ever needed — the fields are BackOne additions to ZT_Peer itself (include/ZeroTierOne.h:1460,1467). What was true is narrower and much less interesting: a stale comment at service/OneService.cpp:621 asserted the snapshot lacked the fields, which contradicted the two lines directly beneath it and would have sent the next reader looking for a missing C API accessor that already existed. The fields were always live. |
Deleted the stale comment. No functional change. Verified against a live 2-node hybrid lab: /peer reports pqcHybridActive:true on both sides once the key is installed, and false on a classical peer — the same field tools/pqc-lab.sh G4 gates on. Kept here because "the observability does not exist" is an expensive wrong assumption to propagate into the C API surface. |
| B7 | 2026-10-08 | pqconly carried a false security assurance: its name, its Identity.hpp:4 comment ("PQ-only identities, no classic fallback"), and SPEC §C all implied that a peer without PQ support would be refused. It refused nothing. The only site distinguishing the modes was identity generation (Identity.cpp:109); every runtime gate tested pqcMode() != ZT_PQC_MODE_CLASSIC (Peer.hpp:434, Node.cpp:274), so hybrid and pqconly shared a code path and a pqconly node forwarded packets to a fully classical peer with no warning of any kind. Measured on the two-host lab: a pqconly node reported pqcCapable:false hybrid:false paths=3 against a classical peer and pinged it at 0% loss. An operator selecting pqconly for downgrade resistance got neither enforcement nor any signal. |
pqconly is now enforced rather than merely named: Peer::pqconlyPeerRejected() refuses VERB_NETWORK_CONFIG and VERB_NETWORK_CREDENTIALS from non-capable non-root peers (credentials matters most — a COM is what establishes trust for a network). PLANET/MOON are exempt, because all four Earth roots are pqcCapable:false and enforcing against them would sever root topology. The gate keys on _hybridCapable, fixed at HELLO, so the encapsulating peer's staged-but-not-yet-installed key does not trigger a false rejection. hybrid keeps its fallback but emits a downgrade WARNING once per peer, re-armed on recovery. Refusals are counted in pkt_network_config_in_pqconly_rejected / pkt_network_credentials_in_pqconly_rejected. Verified: pqcHybridActive still true and 0% loss between two PQ peers; see docs/pqconly-mode-test.md. |