Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
02c13f6
test(network): restore WebSocket mask-reuse regression
seonghobae Aug 29, 2026
83e99db
fix(network): restore bounded WebSocket frame transport
seonghobae Aug 29, 2026
e8039a6
fix(network): expose restored bounded frame transport
seonghobae Aug 29, 2026
d6c9a77
fix(network): apply canonical frame formatting and compile-safe test …
seonghobae Aug 29, 2026
4923839
fix(network): apply canonical frame formatting
seonghobae Aug 29, 2026
c6fc48f
test(network): remove temporary Vec lint failures
seonghobae Aug 29, 2026
1dabe13
test(network): exercise established frame read and Pong I/O
seonghobae Aug 29, 2026
7de3c0f
test(network): cover WebSocket frame payload ceilings
seonghobae Aug 29, 2026
ec9aad1
test(network): close exact frame coverage gaps
seonghobae Aug 29, 2026
a55b117
test(network): cover public frame failure propagation
seonghobae Aug 29, 2026
a4af8aa
style(network): apply canonical rustfmt diagnostics
seonghobae Aug 29, 2026
fe6038d
style(network): apply canonical rustfmt diagnostics
seonghobae Aug 29, 2026
673d99a
test(network): satisfy strict Clippy on mask-reuse regression
seonghobae Aug 29, 2026
f3cda68
merge: adopt current opening-response fixture repairs
seonghobae Sep 5, 2026
97fab64
merge: integrate shared opening-exchange fixture repair
seonghobae Sep 5, 2026
36e8743
fix(network): source websocket masks from os csprng
seonghobae Sep 9, 2026
52d4afc
fix(network): source websocket client keys from os csprng
seonghobae Sep 9, 2026
f15b4ae
Merge pull request #303 from ContextualWisdomLab/codex/websocket-cspr…
seonghobae Sep 9, 2026
bda8017
Merge pull request #304 from ContextualWisdomLab/codex/websocket-hand…
seonghobae Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ A skipped security, GPU, browser, TLS, or statistical test is not passing eviden
## Release contract

A release requires all current-head checks, complete coverage and docs, updated `CHANGELOG.md`, SBOM and provenance, reproducible artifacts, compatibility evidence, security review, and an explicit version decision. Pre-alpha commits are not releases.

## Reusable verification notes

- RFC 6455 client-frame masks must come from the OS CSPRNG in production paths. Keep deterministic `WebDriverBiDiWebSocketMaskKey::new` values for fixtures only; exercise the live loopback write path with `cargo test -p originweave-network --test webdriver_bidi_websocket_masking_key_reuse --locked`. In this pinned dependency set, `getrandom 0.2` exposes `getrandom::getrandom` but its error does not implement `std::error::Error`; retain it in the typed frame error without manufacturing an error-chain source.
- RFC 6455 opening requests need a distinct unpredictable 16-byte `Sec-WebSocket-Key`. Use `WebDriverBiDiWebSocketClientKey::random` in production assembly and retain `new` for deterministic fixtures; unit-test the private deterministic filler for canonical base64, redaction, and entropy failure.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to OriginWeave are documented in this file. The format follo

### Added

- OS-CSPRNG-backed RFC 6455 WebDriver BiDi opening-request client-key generation for a fresh redacted 16-byte `Sec-WebSocket-Key` nonce; deterministic injected keys remain limited to fixture-oriented APIs.
- OS-CSPRNG-backed WebDriver BiDi WebSocket text and Pong writes that acquire a fresh redacted RFC 6455 masking key before any frame bytes are emitted; entropy failure fails closed and deterministic injected keys remain limited to the existing fixture-oriented APIs.
- Bounded RFC 6455 WebDriver BiDi opening-response validation on the exact peer-verified stream: it admits only HTTP/1.1 `101`, case-insensitive `Upgrade`/`Connection` tokens, and the client-key-correlated `Sec-WebSocket-Accept` value within monotonic time and header-size ceilings; it restores blocking mode and still does not implement WebSocket frames or grant browser/Agent authority.
- Bounded WebDriver BiDi loopback TCP transport that consumes one exact no-DNS connect target, retries only explicitly recoverable local transport failures within repository timeout and attempt ceilings, exposes the stream only after operating-system peer inspection and exact peer verification, supports a consuming handoff of the original stream with typed credential-free peer/session/TLS and bounded-attempt evidence, preserves typed causal errors, and performs no DNS, proxy/PAC, process authentication, TLS, WebSocket, BiDi message, browser-action, or Agent-authority step.
- Exact WebDriver BiDi socket-peer verification that consumes an approved no-DNS connect target, requires the observed IP address and port to match exactly, preserves the TLS requirement and exact correlated session id, and remains inert metadata that does not authenticate an OS process, does not negotiate TLS, perform a WebSocket handshake, or grant Agent authority.
Expand Down Expand Up @@ -67,6 +69,7 @@ All notable changes to OriginWeave are documented in this file. The format follo
- Kept the loopback peer alive until opening-write timeout cleanup completes, removing a macOS close race that could report `EINVAL` after a successful request write without weakening production cleanup failures.
- Kept the invalid opening-response deadline fixture's accepted peer alive through opening-write cleanup, removing the same macOS `EINVAL` race from the integration coverage path.
- Kept the revoked-stream fixture peer alive until local shutdown and fail-closed write classification complete, removing a macOS `ENOTCONN` race from the coverage path.
- Carried the existing connection-lifetime test repairs into the frame-transport stack so inherited tests no longer close the peer before the behavior under test completes; production cleanup errors remain fail-closed.
- Made opening-exchange tests wait for the complete client request and retain the peer until each client assertion finishes, avoiding premature connection closure in both successful and rejected handshakes without changing production error handling.
- Updated research doctoring to pin Chromium canonicalizer evidence to an immutable revision, add RFC 9293, RFC 5280, RFC 8446, RFC 9525, rustls 0.23.42, and Rust `TcpStream` evidence, distinguish the April 2026 Fugu beta from the June 2026 release, and treat vendor benchmark claims as first-party evidence rather than independent validation.

Expand Down
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Additional constraints:
- Do not add hostname reconnect, proxy-environment inheritance, dangerous certificate-verifier hooks, Common Name fallback, TLS 0-RTT, key logging, or secret extraction to a production TLS path.
- Keep changes bounded to one product gap and preserve modular crate boundaries.
- Never claim a test, benchmark, browser integration, TLS identity, GPU execution, release, or merge succeeded without current exact-head evidence.
- For production WebSocket client frames, use the OS-CSPRNG helper on the established stream. Keep injected mask bytes only in deterministic fixtures; `getrandom 0.2` error values are not `std::error::Error` in this pinned build.
- For production RFC 6455 opening requests, use `WebDriverBiDiWebSocketClientKey::random`; retain `new` only for deterministic fixture nonces.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/originweave-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ publish = false

[dependencies]
base64 = "0.22.1"
getrandom = "0.2.17"
originweave-core = { path = "../originweave-core" }
originweave-destination = { path = "../originweave-destination" }
sha1 = "0.10.6"
Expand Down
23 changes: 14 additions & 9 deletions crates/originweave-network/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
//! Direct-only policy-bound TCP connection authority for OriginWeave.
//! Direct-only policy-bound TCP and WebSocket transport authority for OriginWeave.
//!
//! The crate consumes validated connection plans, opens exact socket addresses
//! without hostname resolution or proxy inheritance, verifies operating-system
//! peers before exposing transport I/O, and emits credential-free evidence.
//! It also bridges a session-correlated WebDriver BiDi loopback target from
//! `originweave-core` into one bounded exact TCP connection, binds an RFC 6455
//! opening request to that verified plain stream, can write that exact request
//! under one bounded deadline, and validates its bounded RFC 6455 opening response
//! without implementing WebSocket framing or granting browser, WebSocket, TLS,
//! policy, or Agent authority.
//! `originweave-core` into one bounded exact TCP connection, binds and validates
//! the RFC 6455 opening exchange, and provides bounded masked client writes and
//! unmasked server-frame reads without granting browser, TLS, policy, or Agent
//! authority.

#![forbid(unsafe_code)]
#![deny(missing_docs)]

mod connection;
mod webdriver_bidi_connection;
mod webdriver_bidi_websocket_frame;
mod webdriver_bidi_websocket_handshake;
mod webdriver_bidi_websocket_opening_recovery;

Expand All @@ -26,11 +26,16 @@ pub use webdriver_bidi_connection::{
WebDriverBiDiTcpConnection, WebDriverBiDiTcpConnectionError,
WebDriverBiDiTcpConnectionEvidence, WebDriverBiDiTcpConnectionPlan,
};
pub use webdriver_bidi_websocket_frame::{
MAX_WEBSOCKET_FRAME_PAYLOAD_SIZE, MAX_WEBSOCKET_FRAME_TIMEOUT,
WebDriverBiDiWebSocketEstablished, WebDriverBiDiWebSocketFrame,
WebDriverBiDiWebSocketFrameError, WebDriverBiDiWebSocketHandshakePlan,
WebDriverBiDiWebSocketMaskKey, WebDriverBiDiWebSocketOpeningRequestSent,
};
pub use webdriver_bidi_websocket_handshake::{
MAX_WEBSOCKET_OPENING_RESPONSE_SIZE, MAX_WEBSOCKET_OPENING_RESPONSE_TIMEOUT,
MAX_WEBSOCKET_OPENING_WRITE_TIMEOUT, WebDriverBiDiWebSocketClientKey,
WebDriverBiDiWebSocketEstablished, WebDriverBiDiWebSocketHandshakeError,
WebDriverBiDiWebSocketHandshakePlan, WebDriverBiDiWebSocketHandshakeResponseError,
WebDriverBiDiWebSocketOpeningRequestSent, WebDriverBiDiWebSocketOpeningWriteError,
WebDriverBiDiWebSocketHandshakeError, WebDriverBiDiWebSocketHandshakeResponseError,
WebDriverBiDiWebSocketOpeningWriteError,
};
pub use webdriver_bidi_websocket_opening_recovery::WebDriverBiDiWebSocketOpeningWriteRecoveryDisposition;
Loading
Loading