Skip to content

Finish naming the right stack, in tests and setup_cert - #104

Merged
QuiteYellow merged 1 commit into
mainfrom
fix/name-the-right-stack-in-tests
Sep 19, 2026
Merged

QuiteYellow merged 1 commit into
mainfrom
fix/name-the-right-stack-in-tests

Conversation

@QuiteYellow

Copy link
Copy Markdown
Owner

Finishes #101. That sweep covered the package and the docs and stopped there; six sites in tests/ and setup_cert.py kept the attribution, including the one #101 singled out.

test_endpoint.py:430 was the missed defect. It still read "RT-OCF binds its DTLS socket to port 0 (rt_udp.c rt_udp_open_server), so the secure port is kernel-assigned" — the same hardware claim derived from a codebase these devices do not run, sitting in the test that pins the endpoint.py fix. It now cites the stack they do run: the unicast secure socket's port is initialised to 0 (caipadapter.c:219) and read back from getsockname (caipserver.c:826), with a pointer to the page that says which tree and pin those lines are from.

The other five keep their observation and drop the stack: test_ocf_discovery.py ("the stack binds its secure socket with port 0"), test_observe_block2.py ("the appliance tested there"), the two §4.5/MID dedupe notes ("unverified on the appliances here"), and setup_cert.py's docstring ("Samsung appliances").

dtls_session.py gets a note and no behaviour change. The comment justifying one-byte OBSERVE tokens says Samsung silently drops TKL>1 registrations. No commit message, issue or capture in this repository is behind that, and the likely source files contradict it: the stack accepts tokens up to CA_MAX_TOKEN_LEN 8 and its receive path records the parsed length with no width check anywhere. Its observer lookup compares only the incoming token's length, so a short token collides with any held token it prefixes, and a collision is answered with silence — which reads as a dead device. One byte is the width most likely to collide, over 192 distinct values as minted here.

The width stays as it is. Changing it is a wire change against hardware that cannot be replaced, and it wants testing across models rather than an edit made from a source reading. The note records what is known so the next person does not have to rediscover it.

800 tests pass. docs/api.md is unchanged, and share safety is clean.

The sweep in a965724 covered the package and the docs. Six sites in
tests/ and setup_cert.py were missed, including the one that commit
singled out as the real defect: test_endpoint.py still derived an
appliance's port binding from rt_udp.c, in the very test that pins the
fix.

Where a mechanism is wanted, the comment now cites the stack these
appliances run — the unicast secure socket's port is initialised to 0
and read back from getsockname — and names the page that says which
tree and pin those lines are from. The rest drop the attribution and
keep the observation, as the earlier sweep did.

dtls_session.py gets a note and no behaviour change. The TKL>1 claim
behind one-byte OBSERVE tokens has no source anywhere in the repository,
and the likely source files contradict it: the stack accepts tokens to
CA_MAX_TOKEN_LEN 8 and its receive path records the parsed length with
no width check. Its observer lookup compares only the incoming token's
length, so a short token collides with any held token it prefixes, and
the collision is answered with silence that reads as a dead device. One
byte is therefore the width most likely to collide. Widening it is a
wire change against hardware that cannot be replaced, so it wants
testing across models rather than a quiet edit.
@QuiteYellow
QuiteYellow merged commit fabb3e6 into main Sep 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant