Skip to content

Test the ECDH participant gate that mutation testing found unguarded - #945

Merged
kwsantiago merged 1 commit into
mainfrom
test-ecdh-participant-gate
Aug 4, 2026
Merged

Test the ECDH participant gate that mutation testing found unguarded#945
kwsantiago merged 1 commit into
mainfrom
test-ecdh-participant-gate

Conversation

@kwsantiago

Copy link
Copy Markdown
Contributor

Summary

The check that a completed-secret announcement came from an actual participant in the ECDH session had no test. The function around it reads as covered: there is a test named for rejecting an unknown session, and it does reject one, but it returns at the session lookup twenty lines earlier and never reaches the authorisation that follows. Coverage of the function was not coverage of the gate inside it.

Mutation testing is what surfaced it rather than reading. Two mutations of that gate survived a previous run: inverting the pubkey comparison, so it matches every peer except the real one, and deleting the negation on the result, so participants are refused and everyone else admitted. Either one hands a derived shared secret to a key that is not in the session, and nothing in the suite objected to either.

No behavior changes here. This is the test that was missing.

Test plan

Two tests, and the second is what makes the first mean anything. With no peer registered the lookup returns nothing and every sender fails the gate, so a refusal on its own would prove only that something refused, not that identity was checked. The first sends a key that is not a participant and requires refusal; the second sends the registered participant's key with a deliberately wrong-length secret and requires the failure to move past the gate to the length conversion, which shows the gate discriminates on identity rather than rejecting whatever reaches it.

Verified against the mutants rather than assumed: both survivors are killed by these tests, checked by applying each mutation directly and confirming the suite goes red, then restoring. The whole crate's library tests pass, formatter and clippy clean.

Worth noting for anyone extending this: the crate's integration tests need the testing feature, so a bare cargo test -p keep-frost-net fails on unrelated unresolved imports before reaching anything here.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kwsantiago, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ba0e738-f2b5-487a-85b9-0ae57ac26191

📥 Commits

Reviewing files that changed from the base of the PR and between 11a9a2a and dba2acf.

📒 Files selected for processing (1)
  • keep-frost-net/src/node/ecdh.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwsantiago
kwsantiago merged commit 25e555e into main Aug 4, 2026
12 checks passed
@kwsantiago
kwsantiago deleted the test-ecdh-participant-gate branch August 4, 2026 22:02
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