-
Notifications
You must be signed in to change notification settings - Fork 5
Redesign ModifiableVariableProperty with generic structure and length constraints #223
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
Merged
Conversation
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
… constraints - Replaced Type enum with Purpose enum for protocol-agnostic semantic classification - Replaced Format enum with Encoding enum for comprehensive data encoding formats - Added length constraint parameters: minLength, maxLength, expectedLength - Removed protocol-specific fields for better generalization - Updated ModifiableVariableAnalyzer with new analysis methods for length constraints - Enhanced test suite to cover new features and length validation capabilities - Improved documentation with comprehensive usage examples This design provides more structural information about fields while being applicable across different protocols and data formats, not just TLS-specific. Resolves: #203
ic0ns
commented
Jun 11, 2025
Contributor
Author
ic0ns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the code that is not needed anymore
src/main/java/de/rub/nds/modifiablevariable/ModifiableVariableProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/ModifiableVariableProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/ModifiableVariableProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/ModifiableVariableProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/ModifiableVariableProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/util/ModifiableVariableAnalyzer.java
Outdated
Show resolved
Hide resolved
Comment on lines
305
to
316
| /** | ||
| * Finds all fields marked as critical. | ||
| * | ||
| * @param clazz The class to analyze | ||
| * @return A list of fields marked as critical | ||
| */ | ||
| public static List<Field> getCriticalFields(Class<?> clazz) { | ||
| return getAnnotatedFields(clazz).stream() | ||
| .filter(field -> field.getAnnotation(ModifiableVariableProperty.class).critical()) | ||
| .collect(Collectors.toList()); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
src/main/java/de/rub/nds/modifiablevariable/util/ModifiableVariableAnalyzer.java
Outdated
Show resolved
Hide resolved
src/main/java/de/rub/nds/modifiablevariable/util/ModifiableVariableAnalyzer.java
Outdated
Show resolved
Hide resolved
src/test/java/de/rub/nds/modifiablevariable/ModifiableVariablePropertyTest.java
Outdated
Show resolved
Hide resolved
- Simplify verbose JavaDoc descriptions - Update signature example with plausible length values (70-73 bytes) - Remove critical parameter from annotation and all related usage - Remove "or credential" from CERTIFICATE documentation - Clarify expectedLength as hint for typical length - Update example comments for clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Remove expectedLength usage from random value example in JavaDoc to address reviewer feedback about its semantics.
VERSION was too protocol-specific. Replace with existing CONSTANT purpose to maintain protocol-agnostic design.
Remove EXTENSION, CONTROL, and PAYLOAD purposes to make the annotation more protocol-agnostic. Updated JavaDoc example to use PLAINTEXT instead.
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.
Summary
ModifiableVariablePropertyannotation to be more generic and informativeTypeenum withPurposeenum for protocol-agnostic semantic classificationFormatenum withEncodingenum with comprehensive data encoding formatsminLength,maxLength,expectedLengthfor better field specificationModifiableVariableAnalyzerwith new methods for length constraint analysisKey Improvements
Better Length Information: The annotation now supports specifying minimum, maximum, and expected length constraints for fields, providing crucial structural information.
Protocol Agnostic: Removed TLS-specific elements and made the annotation suitable for any protocol or data structure.
Enhanced Encoding Support: Added comprehensive encoding format options including ASN.1, PKCS formats, PEM, DER, Base64, endianness options, and more.
Improved Analysis: New utility methods for grouping fields by length constraints and finding fields with specific length requirements.
Usage Examples
Resolves #203