Add protocol v1: versioned, bounded frames (Hello, Welcome, Intent, IntentResult, environment/organism views, Close) carrying session, epoch and commit watermark, with an explicit little-endian canonical codec, a header-first FrameReader, seeded mutation tests and a libFuzzer target. SessionAdmission enforces world/region scope, grant lifetime and skew, single-use grants, one session per subject, epoch, replay, tick window and per-session rate. Dev identity is a 108-byte HMAC-SHA256 grant (PSA) that cannot be created or verified outside the dev environment. Transport security is TLS 1.3 only via pinned Mbed TLS 4.1.1 LTS with TLS 1.2, DTLS, tickets and PSK compiled out, AEAD suites, ECDHE groups and a pinned dev CA. Opt-in EVO_BUILD_NETWORK, new network CI suite. Sockets and region integration follow in M9.7. ADR-0082 records the decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
647 B
C++
20 lines
647 B
C++
#pragma once
|
|
#include <expected>
|
|
#include <source_location>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
|
|
namespace evo::network_test {
|
|
inline void check(bool ok, std::source_location at = std::source_location::current()) {
|
|
if (!ok)
|
|
throw std::runtime_error(std::string{"network "} + at.file_name() + ":" +
|
|
std::to_string(at.line()));
|
|
}
|
|
template <typename T, typename E> bool refused(const std::expected<T, E>& r, E e) {
|
|
return !r && r.error() == e;
|
|
}
|
|
void protocol_tests();
|
|
void tls_tests();
|
|
} // namespace evo::network_test
|
|
#define CHECK(...) ::evo::network_test::check(static_cast<bool>(__VA_ARGS__))
|