-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactoring + Insert Modification for Strings, Integer, BigInteger, Long + Some more Modifications for Long #182
base: main
Are you sure you want to change the base?
Conversation
Modification classes. Also simplify some conditions in validateAssertions() and modify() methods.
…logging methods with parameterized log messages
…ification was not modified, just copied.
…ually return modified copies and not only the same modification.
…modification types instead of constant integers. This also unifies the method in all factories. Also remove unnecessary semicolons from previous commit.
…rayInsertModification class. To make the String modifiable variable more complete. Naming it InsertValue to keep it consistent with append and prepend, though the other Modification classes put "value" only behind Explicit Modifications.
* origin/main: build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.2.1 to 4.2.4 ci: Use Maven 3.9.9 ci: Switch to recordCoverage plugin build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.2.0 to 4.2.1 build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.17 to 4.2.0 build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.16 to 4.1.17 build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.10 to 4.1.16 build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.9 to 4.1.10 release: Prepare for next development iteration release: v4.2.2 Added suppressing adapters to leave default values out of XML build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.7 to 4.1.9 build(deps): bump de.rub.nds:protocol-toolkit-bom from 4.1.6 to 4.1.7 fixed and supressed warning added generics added supression of warning as its a test with reflections closes scanner after use
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.
Rest looks pretty good
src/main/java/de/rub/nds/modifiablevariable/string/StringAppendValueModification.java
Show resolved
Hide resolved
…it more semantic. There is no real reason for this change. Now the magic numbers, are a little bit less magic (just counting up the different modifications)
SSH-Fuzzer hat defined some modificiations using the explicitValueModificationGenerator() method. It makes not much sense for me to define them not well structured in the SSH-Fuzzer (and abusing explicit modifications for this). The Mutations that got moved over are: - Append - Insert - Prepend for Integer, BigInteger, ByteArray and Long These Modifications do currently produce no usefull values for negative parameters, but if someone needs this, he should revise this. For our work, we mostly need only positiv values. I also added the missing modifications for long, since SFTP uses longs. And also added multiply modifiaction to integer.
Head branch was pushed to by a user without write access
That got me thinking, I think I'll change the behavior completely, so that the insert works for arbitrary positions, which would be better for random positions that don't necessarily take the length of the original value into account. |
…eger and Long, so that they actually make sense. Before the calculations where copied form SSH-Fuzzer, but they do not really produce values that makes any sense. Because the values were shifted and then a new value were added, but adding a value to a binary integer, does not produce the expected insertion. Now we insert the values bitwise, I see a use-case for this. e.g. in mask fields. Also let the insert position wrap around in all insert modifications. For int and long it wraps around the bit size.
…ons and use standard prime number instead.
Also some refactoring
…ng null as object. I think it makes no sense to allow null as copy object.
… wil see the same Warnings, in IntelliJ.
…icit value modifications.
PathExplicitValueFromFileModification
… null if the value is null.
…make it a little bit faster, since we do not need the synchronisation of StringBuffer. fix test, since I changed toString of ModifiableByteArray
…inputs, that still results in modifications. Add Delete modification for Path and Strings.
…gth > 255 correctly up to length of 65535
…mented using innerToString() but good enough for now.
…sition, that wraps around. And always apply xor, even if xor is to long for original value -> cut of to long part. This probably does not match the expected behavior of all users, so further improvements can be made in the future.
Includes some refactoring:
Adds some more modifications, including StingInsertValueModification