Skip to content

Commit 81ed7e1

Browse files
Small formatting changes
1 parent 3c4b9c7 commit 81ed7e1

File tree

5 files changed

+64
-69
lines changed

5 files changed

+64
-69
lines changed

ModifiableVariable/src/main/java/de/rub/nds/tlsattacker/modifiablevariable/ModifiableVariableFactory.java

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*
44
* Copyright 2014-2016 Ruhr University Bochum / Hackmanit GmbH
55
*
6-
* Licensed under Apache License 2.0
7-
* http://www.apache.org/licenses/LICENSE-2.0
6+
* Licensed under Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0
87
*/
98
package de.rub.nds.tlsattacker.modifiablevariable;
109

@@ -25,62 +24,62 @@ private ModifiableVariableFactory() {
2524
}
2625

2726
public static ModifiableBigInteger createBigIntegerModifiableVariable() {
28-
return new ModifiableBigInteger();
27+
return new ModifiableBigInteger();
2928
}
3029

3130
public static ModifiableInteger createIntegerModifiableVariable() {
32-
return new ModifiableInteger();
31+
return new ModifiableInteger();
3332
}
3433

3534
public static ModifiableByte createByteModifiableVariable() {
36-
return new ModifiableByte();
35+
return new ModifiableByte();
3736
}
3837

3938
public static ModifiableByteArray createByteArrayModifiableVariable() {
40-
return new ModifiableByteArray();
39+
return new ModifiableByteArray();
4140
}
42-
41+
4342
public static ModifiableLong createLongModifiableVariable() {
44-
return new ModifiableLong();
43+
return new ModifiableLong();
4544
}
4645

4746
public static ModifiableBigInteger safelySetValue(ModifiableBigInteger mv, BigInteger value) {
48-
if (mv == null) {
49-
mv = new ModifiableBigInteger();
50-
}
51-
mv.setOriginalValue(value);
52-
return mv;
47+
if (mv == null) {
48+
mv = new ModifiableBigInteger();
49+
}
50+
mv.setOriginalValue(value);
51+
return mv;
5352
}
5453

5554
public static ModifiableInteger safelySetValue(ModifiableInteger mv, Integer value) {
56-
if (mv == null) {
57-
mv = new ModifiableInteger();
58-
}
59-
mv.setOriginalValue(value);
60-
return mv;
55+
if (mv == null) {
56+
mv = new ModifiableInteger();
57+
}
58+
mv.setOriginalValue(value);
59+
return mv;
6160
}
6261

6362
public static ModifiableByte safelySetValue(ModifiableByte mv, Byte value) {
64-
if (mv == null) {
65-
mv = new ModifiableByte();
66-
}
67-
mv.setOriginalValue(value);
68-
return mv;
63+
if (mv == null) {
64+
mv = new ModifiableByte();
65+
}
66+
mv.setOriginalValue(value);
67+
return mv;
6968
}
7069

7170
public static ModifiableByteArray safelySetValue(ModifiableByteArray mv, byte[] value) {
72-
if (mv == null) {
73-
mv = new ModifiableByteArray();
74-
}
75-
mv.setOriginalValue(value);
76-
return mv;
71+
if (mv == null) {
72+
mv = new ModifiableByteArray();
73+
}
74+
mv.setOriginalValue(value);
75+
return mv;
7776
}
78-
77+
7978
public static ModifiableLong safelySetValue(ModifiableLong mv, Long value) {
80-
if (mv == null) {
81-
mv = new ModifiableLong();
79+
if (mv == null) {
80+
mv = new ModifiableLong();
8281
}
83-
mv.setOriginalValue(value);
84-
return mv;
82+
mv.setOriginalValue(value);
83+
return mv;
8584
}
8685
}

ModifiableVariable/src/test/java/de/rub/nds/tlsattacker/modifiablevariable/ModifiableVariableTest.java

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*
44
* Copyright 2014-2016 Ruhr University Bochum / Hackmanit GmbH
55
*
6-
* Licensed under Apache License 2.0
7-
* http://www.apache.org/licenses/LICENSE-2.0
6+
* Licensed under Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0
87
*/
98
package de.rub.nds.tlsattacker.modifiablevariable;
109

@@ -24,51 +23,51 @@
2423
* @author Juraj Somorovsky <juraj.somorovsky@rub.de>
2524
*/
2625
public class ModifiableVariableTest {
27-
26+
2827
private static final Logger LOGGER = LogManager.getLogger(ModifiableVariableTest.class);
2928

3029
@Test
3130
public void testRandomBigIntegerModification() {
32-
ModifiableBigInteger bigInteger = ModifiableVariableFactory.createBigIntegerModifiableVariable();
33-
bigInteger.setOriginalValue(BigInteger.ZERO);
34-
bigInteger.createRandomModificationAtRuntime();
35-
LOGGER.info("Randomly modified big integer: " + bigInteger.getValue());
36-
assertNotNull(bigInteger.getModification());
31+
ModifiableBigInteger bigInteger = ModifiableVariableFactory.createBigIntegerModifiableVariable();
32+
bigInteger.setOriginalValue(BigInteger.ZERO);
33+
bigInteger.createRandomModificationAtRuntime();
34+
LOGGER.info("Randomly modified big integer: " + bigInteger.getValue());
35+
assertNotNull(bigInteger.getModification());
3736
}
3837

3938
@Test
4039
public void testRandomIntegerModification() {
41-
ModifiableInteger integer = ModifiableVariableFactory.createIntegerModifiableVariable();
42-
integer.setOriginalValue(0);
43-
integer.createRandomModificationAtRuntime();
44-
LOGGER.info("Randomly modified integer: " + integer.getValue());
45-
assertNotNull(integer.getModification());
40+
ModifiableInteger integer = ModifiableVariableFactory.createIntegerModifiableVariable();
41+
integer.setOriginalValue(0);
42+
integer.createRandomModificationAtRuntime();
43+
LOGGER.info("Randomly modified integer: " + integer.getValue());
44+
assertNotNull(integer.getModification());
4645
}
4746

4847
@Test
4948
public void testRandomByteArrayModification() throws Exception {
50-
ModifiableByteArray array = ModifiableVariableFactory.createByteArrayModifiableVariable();
51-
array.setOriginalValue(new byte[] { 0, 1, 2 });
52-
array.createRandomModificationAtRuntime();
53-
LOGGER.info("Randomly modified byte array: " + ArrayConverter.bytesToHexString(array.getValue()));
54-
assertNotNull(array.getModification());
49+
ModifiableByteArray array = ModifiableVariableFactory.createByteArrayModifiableVariable();
50+
array.setOriginalValue(new byte[]{0, 1, 2});
51+
array.createRandomModificationAtRuntime();
52+
LOGGER.info("Randomly modified byte array: " + ArrayConverter.bytesToHexString(array.getValue()));
53+
assertNotNull(array.getModification());
5554
}
56-
55+
5756
@Test
5857
public void testRandomSingleByteModification() throws Exception {
59-
ModifiableByte singleByte = ModifiableVariableFactory.createByteModifiableVariable();
60-
singleByte.setOriginalValue((byte)0);
61-
singleByte.createRandomModificationAtRuntime();
62-
LOGGER.info("Randomly modified byte: " + ArrayConverter.bytesToHexString(new byte[] { singleByte.getValue() }));
63-
assertNotNull(singleByte.getModification());
58+
ModifiableByte singleByte = ModifiableVariableFactory.createByteModifiableVariable();
59+
singleByte.setOriginalValue((byte) 0);
60+
singleByte.createRandomModificationAtRuntime();
61+
LOGGER.info("Randomly modified byte: " + ArrayConverter.bytesToHexString(new byte[]{singleByte.getValue()}));
62+
assertNotNull(singleByte.getModification());
6463
}
65-
64+
6665
@Test
6766
public void testRandomLongModification() throws Exception {
68-
ModifiableLong modLong = ModifiableVariableFactory.createLongModifiableVariable();
69-
modLong.setOriginalValue(new Long(0));
70-
modLong.createRandomModificationAtRuntime();
71-
LOGGER.info("Randomly modified Long: " + modLong.getValue());
72-
assertNotNull(modLong.getModification());
67+
ModifiableLong modLong = ModifiableVariableFactory.createLongModifiableVariable();
68+
modLong.setOriginalValue(new Long(0));
69+
modLong.createRandomModificationAtRuntime();
70+
LOGGER.info("Randomly modified Long: " + modLong.getValue());
71+
assertNotNull(modLong.getModification());
7372
}
7473
}

resources/testsuite/CiphersuiteCompatibility/TLS_DHE_DSS_WITH_AES_256_CBC_SHA256/supported/TLS12.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<Certificate>
1818
<messageIssuer>SERVER</messageIssuer>
1919
</Certificate>
20+
<DHEServerKeyExchange>
21+
<messageIssuer>SERVER</messageIssuer>
22+
</DHEServerKeyExchange>
2023
<ServerHelloDone>
2124
<messageIssuer>SERVER</messageIssuer>
2225
</ServerHelloDone>

resources/testsuite/CiphersuiteCompatibility/TLS_DH_RSA_WITH_AES_128_CBC_SHA256/supported/TLS12.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<Certificate>
1818
<messageIssuer>SERVER</messageIssuer>
1919
</Certificate>
20-
<DHEServerKeyExchange>
21-
<messageIssuer>SERVER</messageIssuer>
22-
</DHEServerKeyExchange>
2320
<ServerHelloDone>
2421
<messageIssuer>SERVER</messageIssuer>
2522
</ServerHelloDone>

resources/testsuite/CiphersuiteCompatibility/TLS_DH_RSA_WITH_AES_256_CBC_SHA256/supported/TLS12.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<Certificate>
1818
<messageIssuer>SERVER</messageIssuer>
1919
</Certificate>
20-
<DHEServerKeyExchange>
21-
<messageIssuer>SERVER</messageIssuer>
22-
</DHEServerKeyExchange>
2320
<ServerHelloDone>
2421
<messageIssuer>SERVER</messageIssuer>
2522
</ServerHelloDone>

0 commit comments

Comments
 (0)