Files
BackOne/node
proitlab 2e2b0910a8 pqconly: enforce PQ peers, including on the config-serve path
`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
..
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00
2025-11-19 16:23:45 +07:00

ZeroTier Network Hypervisor Core

This directory contains the real ZeroTier: a completely OS-independent global virtual Ethernet switch engine. This is where the magic happens.

Give it wire packets and it gives you Ethernet packets, and vice versa. The core contains absolutely no actual I/O, port configuration, or other OS-specific code (except Utils::getSecureRandom()). It provides a simple C API via /include/ZeroTierOne.h. It's designed to be small and maximally portable for future use on small embedded and special purpose systems.

Code in here follows these guidelines:

  • Keep it minimal, especially in terms of code footprint and memory use.
  • There should be no OS-dependent code here unless absolutely necessary (e.g. getSecureRandom).
  • If it's not part of the core virtual Ethernet switch it does not belong here.
  • No C++11 or C++14 since older and embedded compilers don't support it yet and this should be maximally portable.
  • Minimize the use of complex C++ features since at some point we might end up "minus-minus'ing" this code if doing so proves necessary to port to tiny embedded systems.