Finish naming the right stack, in tests and setup_cert - #104
Merged
Merged
Conversation
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.
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.
Finishes #101. That sweep covered the package and the docs and stopped there; six sites in
tests/andsetup_cert.pykept the attribution, including the one #101 singled out.test_endpoint.py:430was 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 theendpoint.pyfix. It now cites the stack they do run: the unicast secure socket's port is initialised to 0 (caipadapter.c:219) and read back fromgetsockname(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"), andsetup_cert.py's docstring ("Samsung appliances").dtls_session.pygets a note and no behaviour change. The comment justifying one-byte OBSERVE tokens says Samsung silently dropsTKL>1registrations. No commit message, issue or capture in this repository is behind that, and the likely source files contradict it: the stack accepts tokens up toCA_MAX_TOKEN_LEN8 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.mdis unchanged, and share safety is clean.