fix: v0.4.1 — RELAY ecosystem audit fixes, pass 2 - #49
Merged
Conversation
Second round of fixes from the SoundMatt x-Net ecosystem audit
(cpp-LIN-N2-01, cpp-LIN-01/02/03/05/06/07/11/12/13/14/15/16/17/18):
- Add verify_checksum() to actually validate a received checksum against
the locally-computed value (ISO 17987 frame reception); HARA SG-03
downgraded from "Implemented" to "Partial" since no real (non-virtual)
bus backend calls it yet.
- Replace the generic ErrTimeout returned by send_header on no slave
response with a distinct lin::Errc::no_response sentinel that still
compares equivalent to a timeout for existing callers.
- from_message now rejects an unrecognized lin.checksum_type instead of
silently defaulting to Classic.
- Bump declared RELAY spec version 1.11 -> 2.0 across headers, CLI JSON,
README, HARA, and requirements (RELAY v2.0's breaking change is scoped
to RCP and does not alter LIN's canonical types).
- Fix testdata/relay-vectors/lin-frame.json to encode checksum_type as
"enhanced" instead of the bare numeral "1" (independently verified: the
vector's checksum 73 matches the Enhanced algorithm for id=16,
payload={0xAA,0xBB}, not Classic).
- master::Node::set_schedule now accepts an empty schedule (spec Sec 8.3),
matching the virtual bus.
- DropOldest back-pressure now counts an eviction as a drop instead of a
delivery.
- Frame::checksum_type now defaults to Classic (the enum zero value),
matching the other language bindings' canonical default.
- capabilities no longer lists "virtual" in both features and transports.
- E2E Receiver::unwrap no longer advances its sequence counter on a
rejected frame, so a persistent shifted stream keeps being flagged
instead of silently resyncing after one error.
- Define the previously-dangling REQ-CLI-001..006 / REQ-SEC-013
requirements referenced by existing fusa:req tags; correct three
requirement rationales that cited the wrong Safety Goal; fix HARA's
error-handling citation (Sec 15 -> Sec 5) and stale spec version.
- Add CHANGELOG.md.
Reproduced locally: cmake configure + build clean, ctest 171/171 pass.
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second round of fixes from the SoundMatt x-Net ecosystem audit against cpp-LIN. Applies 15 of the 15 diffs marked "ready" in the audit register (cpp-LIN-N2-01, cpp-LIN-01/02/03/05/06/07/11/12/13/14/15/16/17/18), reviewed and cross-checked individually against the underlying findings before applying. Bumps to v0.4.1.
verify_checksum()to actually validate a received checksum against the locally-computed value (ISO 17987 frame reception). HARA SG-03 downgraded from "Implemented" to "Partial" — no real (non-virtual) bus backend calls the new function yet, and no dedicated unit test was included in the source diff, so the safety claim is intentionally left honest rather than "closed."ErrTimeoutreturned bysend_headeron no slave response with a distinctlin::Errc::no_responsesentinel that still compares equivalent to a timeout for existing callers. (The pre-existing deadlin::ErrNoResponseexception class and its false-coverage test are untouched — that cleanup is bundled with the still-open advisory cpp-LIN-08 test-gap item, out of scope here.)from_messagenow rejects an unrecognizedlin.checksum_typeinstead of silently defaulting to Classic.v1.11reference inHARA.md:134that neither source diff touched.testdata/relay-vectors/lin-frame.jsonto encodechecksum_typeas"enhanced"instead of the bare numeral"1"— independently re-derived: vector checksum73matches the Enhanced algorithm for id=16, payload{0xAA,0xBB}, not Classic (153).master::Node::set_schedulenow accepts an empty schedule (spec §8.3), matching the virtual bus.DropOldestback-pressure now counts an eviction as a drop instead of a delivery.Frame::checksum_typenow defaults to Classic (the enum zero value), matching the other language bindings.capabilitiesno longer lists"virtual"in bothfeaturesandtransports.Receiver::unwrapno longer advances its sequence counter on a rejected frame, so a persistent shifted stream keeps being flagged instead of silently resyncing after one error.REQ-CLI-001..006/REQ-SEC-013requirements referenced by existingfusa:reqtags; correct three requirement rationales that cited the wrong Safety Goal; fix HARA's error-handling citation (§15 → §5).CHANGELOG.md.Not included (advisory only, no diff provided — still open)
relay.hppdepends backwards onlin::Chan— needs an invasive namespace refactor (moveChan<T>intonamespace relay); design decision, not attempted.testdata/relay-vectors/, and mirror the (now-fixed) ErrNoResponse bug instead of asserting the real sentinel — multi-concern test-suite rework, not attempted..fusa-reqs.json(145 reqs after this PR) vsrequirements/requirements.json(100 reqs) disagree on population — canonical-file governance decision needed.ErrPayloadTooLarge— contested sentinel mapping, needs a documented adapter policy decision.Test plan
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debugconfigures cleanlycmake --build buildbuilds cleanly, no new warningsctest --test-dir build --output-on-failure— 171/171 pass (reproduced locally, not just trusting the audit register's self-report)cpp-lin-cli version/capabilitiesoutput at runtime — reports0.4.1/spec_version: 2.0/ de-duplicatedfeatures