fix/audit-usbserial #33

Merged
faicel merged 24 commits from fix/audit-usbserial into dev 2026-10-01 20:46:40 +00:00
Owner
No description provided.
Add the usbserial cargo feature (never implied by other features, following
the ota precedent) with the plain framing tier for the USB-serial link
between the gateway host and the SAMD21 radio head: COBS blocks with a 0x00
delimiter, CRC-16/CCITT-FALSE over type+body, the five link message types
(RX/TX_REQ/TX_RESULT/PING/PONG), the 255-byte radio payload bound (SX1278
8-bit length register), and a streaming Decoder with bounded queue, drop
counters and delimiter resync. Fully additive and no_std: plain sensor and
gateway builds carry zero usbserial code. The compile_error! guard, the
supported-configuration contract comments and the feature-matrix gate now
accept the usbserial configurations.
Add the secure half of the usbserial link tier: HELLO handshake (clear
nonce[16] both directions, last HELLO pair wins so a forged premature HELLO
cannot poison the channel), HKDF-SHA256 over the 32-byte PSK with
salt = host_nonce || head_nonce and fixed OKM split (host-to-head /
head-to-host key + 4-byte nonce prefix each, mirroring the session derive
pattern), and per-message sealing with the clear u64 counter bound as AAD
together with the clear type byte (type confusion fails the tag check).
Receivers enforce strictly increasing counters and advance the watermark
only after tag verification, so replayed or forged frames cannot desync the
channel. The PSK and derived keys are zeroized on drop and never rendered
by Debug. Refactors the shared internals (write_body / parse_body) so the
plain and secure paths share one serializer and one parser.
Bump the crate to 1.3.0 and document the release in the changelog: the
usbserial link tier (plain framing + PSK-secured channel), the newly
supported standalone feature configuration and the extended feature-matrix
gate.
Two security-audit fixes in the usbserial secure tier. The secure receive
accumulator now uses the sealed-frame bound (SECURE_DECODER_ACC_CAP, 290
bytes) instead of the plain one (265): a max-size sealed RX reaches 289
COBS wire bytes, so payloads of 233 bytes and above were silently dropped
in both directions — pinned by max-size sealed RX and TX_REQ roundtrip
tests, with the feed overflow branch bounded by the same constant. The
secure channel also exposes take_peer_hello_seen(): a sticky flag set
when a peer HELLO arrives, letting the firmware answer it with its own
HELLO (request/response cadence) so a fresh host channel can establish
against an already-established head after any host-side reconnect —
covered by an end-to-end test that rebuilds the host channel against a
live head and trades traffic on the new session.
Owner-approved pre-release rename following the OtaError precedent; no
Error alias retained (breaking, major-bump consequence noted in the
changelog). Also escape the payload[len] bracket links in the module-doc
message-types table, a pre-existing doc lint surfaced by the rustdoc
-D warnings gate.
chore(sigil): materialize the 2.0.0 release version
Some checks failed
Run checks on feature branches / rust-crate-checks (push) Failing after 2m27s
Run checks on feature branches / checks (push) Failing after 0s
134bb08ae3
update version
All checks were successful
Run checks on feature branches / rust-crate-checks (push) Successful in 2m37s
Run checks on feature branches / checks (push) Successful in 0s
Validate branch flow / validate-flow (pull_request_target) Successful in 1s
Validate branch flow / validate (pull_request_target) Successful in 0s
dd02337768
Merge branch 'dev' into fix/audit-usbserial
All checks were successful
Validate branch flow / validate-flow (pull_request_target) Successful in 1s
Validate branch flow / validate (pull_request_target) Successful in 0s
Run checks on feature branches / rust-crate-checks (push) Successful in 2m39s
Run checks on feature branches / checks (push) Successful in 0s
279c7056dd
faicel deleted branch fix/audit-usbserial 2026-10-01 20:46:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
homeiot/sigil!33
No description provided.