Temporaries borrowed past their statement (control, media), clippy's
is_multiple_of, needless index loop and type complexity. input.rs: the
MOUSE_MOVE_ABS builder dropped the y field; the PROTOCOL.md cross-check would
have caught it at runtime.
default-features = false, features = ["aes", "alloc"]: aes-gcm's default
pulls in getrandom, which would make the OS RNG reachable inside a crate whose
randomness must only come through RandomSource. Approved by the build lead.
Cargo.lock also gains the test-only dev-dependencies (proptest, peak_alloc).
Generated by tools/vectors/gen_vectors.py with Python hashlib, OpenSSL 3.5.7
(Git for Windows) and .NET 10 AesGcm. Keys and certificates are TEST-ONLY,
made fresh on this machine for these tests: RSA-2048 host, client and rogue
identities, and an EC certificate for the non-RSA refusal.
A counting global allocator (peak_alloc) checks that small inputs with lying
length fields and arbitrary inputs never make a parser allocate past a bound
tied to the input and its caps; depacketizers and the ENet peer stay within
their in-flight caps.
All 64 loss patterns of a 4+2 block with two different MDS matrices through
AudioFec::ParityMatrix (U16 unmeasured), encrypted and plain; FEC disabled;
sequence wrap; duplicates; reordering; far-past and far-future; hostile
parity; the loss timeout.
Generated multi-block frames with random, bursty, all-parity, all-data,
last-packet loss, reordering and duplicates; RTP sequence and frame index
wraps; far-past and far-future strays; recovered shard headers deliberately
garbage (bytes 0-31 untrusted); encryption with tampering. Frames are
byte-exact or reported in FrameLost, never corrupt.
Every erasure pattern of size <= m for k 1..=8, m 1..=4 and the Wolf 4+2
example; k = 1..=255-m sweeps for m in 1,2,3,4,8,16,64,127,254; > m refused
with Truncated. with_parity_matrix checked byte-exact against an independent
GF(2^8) Cauchy construction and refused for non-MDS matrices.
RTP header, video packet and frame header, audio packet at every size
boundary; inconsistent FEC fields; video AES-GCM against .NET vectors and
audio AES-CBC against openssl vectors, including rikeyid + seq wrap and bad
padding. The RustCrypto test oracles are checked against the same vectors.
INPUT_DATA built from PROTOCOL.md 4 field tables, cross-checked against its
example bytes; encode, parse, equal for every known type; unknown types,
UNKNOWN-layout types, wrong lengths, lying length and size fields, changed
constants and out-of-range values refused.
Nonce layout (seq LE, 6 zero, direction, 'C'), seal against .NET AesGcm
vectors, every tampered byte, wrong direction and key, lying length fields.
ControlStream drops replayed, older, reflected and forged frames and refuses
seq 0 after u32::MAX. Host message layouts and client message encoding.
Byte vectors built from the PROTOCOL.md 3.1 field definitions, every command
size, truncation, compressed and unknown commands, 32/33 commands and
4096/4097 bytes. Client: handshake, reliable sequence past 0xFFFF -> 0,
duplicates, far-future and far-past, lying fragments, retransmission,
timeout and disconnect.
Bad start lines, header floods, line cap, lying Content-Length (over, under,
past the cap, past u64), 64 KiB+1 in the framer, chunking invariance,
surround-params against RFC 7845, ANNOUNCE intersection, and the client state
machine with hostile answers.
Walks every state with a recorded transcript (fixtures from tools/vectors).
Wrong PIN, wrong hash, wrong cert, rogue and flipped signatures, wrong sizes,
out-of-order, replayed and cross-session answers all end in Failed(reason);
Paired cannot be reached by skipping a step. Crypto helpers, certificates,
identities and the PIN against the same vectors.
XML reader, serverinfo, applist, launch and status answers: empty, 1 byte,
max-1, max, max+1, huge; depth bombs, element, attribute and text caps,
entities, DTD and billion laughs, namespaces. Request builders refuse bad ids
and query injection. proptest round trip of generated XML trees.
Fails if src/ uses std::net, Instant::now, SystemTime::now, std::thread,
std::fs, processes, env reads or OS randomness (comments stripped, grouped
std imports caught). Checks forbid(unsafe_code) and that Debug never prints
rikey, the PIN or the private key.
tools/vectors/gen_vectors.py makes the crypto vectors with tools independent of
RustCrypto: Python hashlib (SHA-256), the OpenSSL 3.5 CLI (RSA-2048 test-only
keys, X.509 certs, PKCS#1 v1.5 SHA-256 signatures, AES-128-ECB -nopad,
AES-128-CBC) and .NET 10 AesGcm (gcm_vectors.cs). Output goes to
crates/domistream/tests/fixtures (text only); not generated in this commit.
tests/common: seeded and scripted RandomSource, fixture reader, an independent
GF(2^8)/0x11D reference with Cauchy matrices, and test hosts that packetize
video (PROTOCOL.md 5.2-5.3) and audio (6.2-6.4).
Dev-dependencies: proptest (std only, no fork/timeout) and peak_alloc (MIT,
counting allocator for the allocation-cap test).