Skip to content

Create and Use InformationLeakTest.getRareResponses (#371) #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 27, 2025

Summary

  • Moved getRareResponses method from SessionTicketPaddingOracleProbe to InformationLeakTest as a non-static method
  • Updated all callers to use the new method location
  • Added comprehensive unit tests for the method

Details

This PR addresses issue #371 by refactoring the getRareResponses method to make it reusable across different probes. The method identifies response patterns that occur rarely (at most N times) across all test vectors, which is useful for various padding oracle and timing attack analyses.

Changes made:

  1. Moved method to InformationLeakTest: The method is now a proper instance method of InformationLeakTest, allowing it to access the test's vector containers directly
  2. Fixed implementation: The method now correctly counts total occurrences across all vectors when determining rare responses
  3. Updated callers: Both SessionTicketPaddingOracleProbe and TicketPaddingOracleResult now use the new method location
  4. Added tests: Created comprehensive unit tests covering various scenarios including:
    • Empty response lists
    • Unique responses
    • Multiple rare responses
    • No rare responses
    • Integration with extended test data

Test plan

  • Unit tests pass for the new getRareResponses method
  • Existing tests still pass after refactoring
  • Code compiles without warnings
  • Spotless formatting applied

- Move getRareResponses method from SessionTicketPaddingOracleProbe to InformationLeakTest as non-static method
- Update SessionTicketPaddingOracleProbe to use the new method location
- Update TicketPaddingOracleResult to use the new method location
- Add comprehensive unit tests for getRareResponses method
- Fix implementation to correctly count total occurrences across all vectors

This change makes the method reusable for other probes that need to identify rare response patterns, improving code organization and reusability.

Fixes #371
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