Repository navigation
Hang up on a message the pod can't use instead of exiting - #23
Merged
Merged
Conversation
Pairing, session setup and the command loop exited the pod with log.Fatal when the phone's message didn't parse, decrypt or unmarshal, and the packet layer exited on an unexpected command. In the Simulator nothing restarts it, so one bad message cost the pod. The pod now logs the error, hangs up and waits for the phone to reconnect and set up a new session. The packet layer logs and carries on. Errors in the pod's own work (generating keys, saving state, building responses) still exit.
ps2
added a commit
that referenced
this pull request
Oct 28, 2026
main gained the recovery from #23 and the EAP-AKA SQN check from #25 while this branch was out. Three things had to be reconciled rather than merged mechanically. The sequence number pairing leaves behind moved from 1 to 0, because CheckSqn accepts a session only if its SQN is past the stored one and the controller's first session uses 1. The Omnipod 5 path was still storing 1, which would have made every freshly paired pod answer its phone's first session with a synchronization failure. There is now a test over the AUTN a controller sends, covering the first session after pairing, a replay and an older session, so the rule is pinned rather than remembered. The setup commands an Omnipod 5 is sent now run before the command-length guard, not after. Their payloads are short ASCII — "G3.12" is five bytes, "S3.9=8,G3.9" eleven — so the sixteen-byte minimum #23 moved ahead of command.Unmarshal would have refused them and hung up mid-activation. The Omnipod 5 pairing and the AID exchange now hang up through startOver like everything else, instead of ending the process. That was the behaviour this branch wanted anyway: the pod's own commit for it is now redundant and gives way to #23's. The link layer keeps this branch's framing, which already returned the errors #23 introduced, and upstream's pod_test.go is carried over onto the mode-aware constructors.
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.
Pairing, session setup and the command loop exited the pod with
log.Fatalwhen a message from the phone didn't parse, decrypt or unmarshal, and the packet layer exited on an unexpected command. In the Simulator nothing restarts the pod, so one bad message lost it. #20 hit this: an EAP-AKA Success that didn't parse.Testing
pkg/pod/pod_test.gosends a garbled message during session setup. Onmainit fails with the pod's EAP-AKA parse error; now the pod hangs up.go test -race ./...passes, and it builds forGOOS=linux GOARCH=arm.