|
7 | 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt
|
8 | 8 | */
|
9 | 9 |
|
10 |
| -/** |
11 |
| - * TLS-Attacker - A Modular Penetration Testing Framework for TLS |
12 |
| - * |
13 |
| - * Copyright 2014-2022 Ruhr University Bochum, Paderborn University, Hackmanit GmbH |
14 |
| - * |
15 |
| - * Licensed under Apache License, Version 2.0 |
16 |
| - * http://www.apache.org/licenses/LICENSE-2.0.txt |
17 |
| - */ |
18 |
| - |
19 | 10 | package de.rub.nds.tlsscanner.core.vector.response;
|
20 | 11 |
|
21 | 12 | import de.rub.nds.modifiablevariable.util.ArrayConverter;
|
|
25 | 16 | import de.rub.nds.tlsattacker.core.protocol.ProtocolMessage;
|
26 | 17 | import de.rub.nds.tlsattacker.core.protocol.message.HandshakeMessage;
|
27 | 18 | import de.rub.nds.tlsattacker.core.protocol.message.ClientHelloMessage;
|
28 |
| -import de.rub.nds.tlsattacker.core.protocol.message.ClientKeyExchangeMessage; |
29 | 19 | import de.rub.nds.tlsattacker.core.protocol.message.ServerHelloMessage;
|
30 | 20 | import de.rub.nds.tlsattacker.core.protocol.message.CertificateMessage;
|
31 |
| -import de.rub.nds.tlsattacker.core.protocol.message.HelloMessage; |
32 |
| -import de.rub.nds.tlsattacker.core.protocol.message.ServerKeyExchangeMessage; |
33 | 21 | import de.rub.nds.tlsattacker.core.protocol.message.ServerHelloDoneMessage;
|
34 | 22 | import de.rub.nds.tlsattacker.core.record.AbstractRecord;
|
35 | 23 | import de.rub.nds.tlsattacker.core.record.Record;
|
|
38 | 26 | import java.util.LinkedList;
|
39 | 27 | import java.util.List;
|
40 | 28 | import de.rub.nds.modifiablevariable.bytearray.ModifiableByteArray;
|
41 |
| -import de.rub.nds.modifiablevariable.VariableModification; |
42 |
| -import de.rub.nds.modifiablevariable.singlebyte.ByteAddModification; |
43 | 29 |
|
44 | 30 | import static org.junit.Assert.*;
|
45 | 31 | import org.junit.Test;
|
@@ -152,9 +138,8 @@ public static Collection<Object[]> generateData() {
|
152 | 138 | Record serverHelloRecord = parseRecord(ProtocolMessageType.HANDSHAKE, ProtocolVersion.TLS12.getValue(), 78,
|
153 | 139 | ArrayConverter.hexStringToByteArray(
|
154 | 140 | "160303004e0200004a03030fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f2400c030000022ff0100010000000000000b0004030001020023000000100005000302683200170000"));
|
155 |
| - Record serverHelloRecordDiffContent = parseRecord(ProtocolMessageType.HANDSHAKE, ProtocolVersion.TLS12.getValue(), 78, |
156 |
| - ArrayConverter.hexStringToByteArray( |
157 |
| - "00")); |
| 141 | + Record serverHelloRecordDiffContent = parseRecord(ProtocolMessageType.HANDSHAKE, |
| 142 | + ProtocolVersion.TLS12.getValue(), 78, ArrayConverter.hexStringToByteArray("00")); |
158 | 143 |
|
159 | 144 | HandshakeMessage certificateMsg =
|
160 | 145 | parseMessage(HandshakeMessageType.CERTIFICATE.getValue(), 4050, null, ArrayConverter.hexStringToByteArray(
|
@@ -348,20 +333,19 @@ public static Collection<Object[]> generateData() {
|
348 | 333 | msgListTestMsgClassWithPriority.add(clientKeyExchangeMsg);
|
349 | 334 | expectedResultMsgClassWithPriority = EqualityError.MESSAGE_CLASS;
|
350 | 335 |
|
351 |
| - //Data for test with expected EqualityError: |
352 |
| - //EqualityError.MessageContent |
| 336 | + // Data for test with expected EqualityError: |
| 337 | + // EqualityError.MessageContent |
353 | 338 | // with PriorityCheck regarding EqualityError.RecordContent
|
354 | 339 | EqualityError expectedResultMsgContentWithPriority;
|
355 | 340 | expectedResultMsgContentWithPriority = EqualityError.MESSAGE_CONTENT;
|
356 |
| - |
| 341 | + |
357 | 342 | List<AbstractRecord> recordListTestServerWithContentError = new LinkedList<>();
|
358 |
| - |
| 343 | + |
359 | 344 | recordListTestServerWithContentError.add(serverHelloRecordDiffContent);
|
360 | 345 | recordListTestServerWithContentError.add(certificateRecord);
|
361 | 346 | recordListTestServerWithContentError.add(serverKeyExchangeRecord);
|
362 | 347 | recordListTestServerWithContentError.add(serverHelloDoneRecord);
|
363 |
| - |
364 |
| - |
| 348 | + |
365 | 349 | // Data for test with expected EqualityError:
|
366 | 350 | // EqualityError.MESSAGE_COUNT
|
367 | 351 | // with PriorityCheck regarding EqualityError.RecordContent
|
@@ -469,8 +453,8 @@ public static Collection<Object[]> generateData() {
|
469 | 453 | // Tests with PriorityCheck regarding EqualityError.Record_Content
|
470 | 454 | { msgListTestClient, recordListTestClient, stateTestClient, msgListTestMsgClassWithPriority,
|
471 | 455 | recordListTestClientWithContentError, stateTestClient, expectedResultMsgClassWithPriority },
|
472 |
| - { msgListTestServer, recordListTestServer, stateTestServer, msgListTestMsgContent, recordListTestServerWithContentError, |
473 |
| - stateTestServer, expectedResultMsgContentWithPriority }, |
| 456 | + { msgListTestServer, recordListTestServer, stateTestServer, msgListTestMsgContent, |
| 457 | + recordListTestServerWithContentError, stateTestServer, expectedResultMsgContentWithPriority }, |
474 | 458 | { msgListTestClient, recordListTestClient, stateTestClient, msgListTestMsgCountWithPriority,
|
475 | 459 | recordListTestClientWithContentError, stateTestClient, expectedResultMsgCountWithPriority },
|
476 | 460 | { msgListTestClient, recordListTestClient, stateTestClient, msgListTestClient,
|
|
0 commit comments