feat(pqc): plumb pqcMode to identity path, hybrid HELLO ct, spec review fixes

- Node stores _pqcMode; Identity::generate(bool,int) derives pq from daemon mode
- OneService reads local.conf settings.pqcMode before new Node (opt-in, absent=classic)
- Peer/IncomingPacket: hybrid KEM ct in HELLO/OK, capability-bit fallback classic
- tools/pqc-lab.sh two-node E2E lab + tools/zt-dissector.lua capture dissector
- docs/pqc-test-scenario.md test plan
- SPEC.md review pass: V12 evidence -> live daemon check, V14/V15 cite realign,
  T24/T25 tasks (pqconly preset gap documented)
This commit is contained in:
dedysutanto committed 2026-10-03 07:01:52 +07:00
1 parent 1ead221c6a
commit fa08792c78
13 files changed
+1058 -144

No files matched your search

+5 -3
View File
@@ -43,7 +43,7 @@ namespace ZeroTier {
/* Public Node interface (C++, exposed via CAPI bindings) */
/****************************************************************************/
Node::Node(void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, int64_t now)
Node::Node(void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, int64_t now, int pqcMode)
: _RR(this)
, RR(&_RR)
, _uPtr(uptr)
@@ -54,7 +54,7 @@ Node::Node(void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, in
, _lastHousekeepingRun(0)
, _lastMemoizedTraceSettings(0)
, _lowBandwidthMode(false)
, _pqcMode(ZT_PQC_MODE_HYBRID)
, _pqcMode(pqcMode)
{
if (callbacks->version != 0) {
throw ZT_EXCEPTION_INVALID_ARGUMENT;
@@ -93,7 +93,9 @@ Node::Node(void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, in
}
if (n <= 0) {
RR->identity.generate();
// Mode drives whether the new identity carries PQC material: classic
// produces a type 0 identity, hybrid/pqconly a type 1 identity.
RR->identity.generate(_pqcMode != ZT_PQC_MODE_CLASSIC, _pqcMode);
RR->identity.toString(false,RR->publicIdentityStr);
RR->identity.toString(true,RR->secretIdentityStr);
idtmp[0] = RR->identity.address().toInt();