Conversation
| if sender.consumed { | ||
| panic("simot: sender session already consumed") | ||
| } | ||
| sender.consumed = true |
There was a problem hiding this comment.
🟡 Reusing a completed sender session crashes the program instead of reporting an error
A second attempt to answer the receiver on an already-finished sender session aborts the whole program (panic("simot: sender session already consumed") at ot/simot/simotlocal.go:122) instead of returning an error like the other steps of the protocol do, so any application that drives this exchange from network messages can be taken down by a duplicate message.
Impact: A duplicated or replayed protocol message can crash a service that uses this package rather than yielding a recoverable error.
One-shot enforcement uses panic in an exported API whose sibling returns errors
Round2Sender is exported and receives B from the remote receiver. The new one-shot guard (ot/simot/simotlocal.go:121-124) reacts to a second invocation with panic, whereas the analogous receiver step Round3Receiver (ot/simot/simotlocal.go:186-189) returns errors.New(...) for invalid input. REVIEW.md requires "Errors are returned, not swallowed. No panic on attacker-controlled input." A caller looping over incoming messages (e.g. a server handling a duplicated round-2 message for the same session) has no way to recover without installing a recover. Consider returning an error (or exposing a distinct method/error return) instead of panicking, and note the behavioral change to the public API in the PR description.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if sender.consumed { | ||
| panic("simot: sender session already consumed") | ||
| } | ||
| sender.consumed = true |
There was a problem hiding this comment.
🟨 Exported protocol step panics on repeated invocation instead of returning an error
The new one-shot guard in Round2Sender (ot/simot/simotlocal.go:121-124) panics when the sender session has already been used. Round2Sender is an exported API driven by remote receiver messages, so an application that processes a duplicated/replayed round-2 message for the same session will crash rather than get a recoverable error. REVIEW.md mandates "Errors are returned, not swallowed. No panic on attacker-controlled input."
Was this helpful? React with 👍 or 👎 to provide feedback.
Uh oh!
There was an error while loading. Please reload this page.