Skip to content

Commit 7262b70

Browse files
committed
All Errors checked
1 parent b0ea6c4 commit 7262b70

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

TLS-Scanner-Core/src/test/java/de/rub/nds/tlsscanner/core/vector/response/FingerprintCheckerTest.java

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ public static Collection<Object[]> generateData() {
150150
ArrayConverter.hexStringToByteArray(
151151
"0200004a03030fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f2400c030000022ff0100010000000000000b0004030001020023000000100005000302683200170000"));
152152
Record serverHelloRecord = parseRecord(ProtocolMessageType.HANDSHAKE, ProtocolVersion.TLS12.getValue(), 78,
153-
ArrayConverter.hexStringToByteArray("160303004e0200004a03030fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f2400c030000022ff0100010000000000000b0004030001020023000000100005000302683200170000"));
153+
ArrayConverter.hexStringToByteArray(
154+
"160303004e0200004a03030fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f2400c030000022ff0100010000000000000b0004030001020023000000100005000302683200170000"));
155+
Record serverHelloRecordDiffContent = parseRecord(ProtocolMessageType.HANDSHAKE, ProtocolVersion.TLS12.getValue(), 78,
156+
ArrayConverter.hexStringToByteArray(
157+
"00"));
154158

155159
HandshakeMessage certificateMsg =
156160
parseMessage(HandshakeMessageType.CERTIFICATE.getValue(), 4050, null, ArrayConverter.hexStringToByteArray(
@@ -231,15 +235,15 @@ public static Collection<Object[]> generateData() {
231235
ModifiableByteArray serverHelloRandomDiffContent = new ModifiableByteArray();
232236
serverHelloRandomDiffContent.setOriginalValue(ServerHelloMessage.getHelloRetryRequestRandom());
233237
serverHelloMsgDiffContent.setRandom(serverHelloRandomDiffContent);
234-
238+
235239
ModifiableByteArray serverHelloRandom = new ModifiableByteArray();
236-
serverHelloRandom.setOriginalValue(ArrayConverter.hexStringToByteArray("0fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f24"));
240+
serverHelloRandom.setOriginalValue(
241+
ArrayConverter.hexStringToByteArray("0fa96863574fc48715a6aa266f5f954a2a3fbcaa6a359b663c21dde3c71e6f24"));
237242
serverHelloMsg.setRandom(serverHelloRandom);
238-
243+
239244
List<ProtocolMessage> msgListTestMsgContent = new LinkedList<>();
240245
EqualityError expectedResultMsgContent;
241246

242-
243247
msgListTestMsgContent.add(serverHelloMsgDiffContent);
244248
msgListTestMsgContent.add(certificateMsg);
245249
msgListTestMsgContent.add(serverKeyExchangeMsg);
@@ -344,17 +348,20 @@ public static Collection<Object[]> generateData() {
344348
msgListTestMsgClassWithPriority.add(clientKeyExchangeMsg);
345349
expectedResultMsgClassWithPriority = EqualityError.MESSAGE_CLASS;
346350

347-
/*
348-
* TODO-------------------------------------------------------------------------------- // Data for test with
349-
* expected EqualityError: // EqualityError.MESSAGE_CONTENT // with PriorityCheck regarding
350-
* EqualityError.RecordContent List<ProtocolMessage> msgListTestMsgContentWithPriority = new LinkedList<>();
351-
* EqualityError expectedResultMsgContentWithPriority;
352-
* msgListTestMsgContentWithPriority.add(clientHelloMsgDiffContent);
353-
* msgListTestMsgContentWithPriority.add(clientKeyExchangeMsg); expectedResultMsgContentWithPriority =
354-
* EqualityError.MESSAGE_CONTENT;
355-
* ------------------------------------------------------------------------------------
356-
*/
357-
351+
//Data for test with expected EqualityError:
352+
//EqualityError.MessageContent
353+
// with PriorityCheck regarding EqualityError.RecordContent
354+
EqualityError expectedResultMsgContentWithPriority;
355+
expectedResultMsgContentWithPriority = EqualityError.MESSAGE_CONTENT;
356+
357+
List<AbstractRecord> recordListTestServerWithContentError = new LinkedList<>();
358+
359+
recordListTestServerWithContentError.add(serverHelloRecordDiffContent);
360+
recordListTestServerWithContentError.add(certificateRecord);
361+
recordListTestServerWithContentError.add(serverKeyExchangeRecord);
362+
recordListTestServerWithContentError.add(serverHelloDoneRecord);
363+
364+
358365
// Data for test with expected EqualityError:
359366
// EqualityError.MESSAGE_COUNT
360367
// with PriorityCheck regarding EqualityError.RecordContent
@@ -388,7 +395,8 @@ public static Collection<Object[]> generateData() {
388395

389396
// generate clientHelloRecord with different ContentType & different Content
390397
Record clientHelloRecordDiffContentTypeWithPriority = parseRecord(ProtocolMessageType.APPLICATION_DATA,
391-
ProtocolVersion.TLS10.getValue(), 512, ArrayConverter.hexStringToByteArray("1603010200010001fc03036ced07c5f0707d08d6c98ab375b523236492233a56eaec0d8feb2565ba7c337720c6b3ba7f6fdf5c643a038d40b56a8db014a6c90359432f3ccbb6db40fa76a9200022130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035010001910000001a00180000157777772e7363686e6569657266616374732e636f6d00170000ff01000100000a000e000c001d00170018001901000101000b00020100002300000010000e000c02683208687474702f312e310005000501000000000022000a000804030503060302030033006b0069001d00204ca75275f38541b0628d64892200b8b184c7b7fd836b4c8c9b3124e753d7577a00170041040c6eae5febeb82f27d09c5cb7155682da96bf0863aeaff721f556885790a3819449702afd594b8c088aa1ea4effaf210867a0c0e430ad460ffe16847b6d1cbc4002b00050403040303000d0018001604030503060308040805080604010501060102030201002d00020101001c0002400100150081000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"));
398+
ProtocolVersion.TLS10.getValue(), 512, ArrayConverter.hexStringToByteArray(
399+
"1603010200010001fc03036ced07c5f0707d08d6c98ab375b523236492233a56eaec0d8feb2565ba7c337720c6b3ba7f6fdf5c643a038d40b56a8db014a6c90359432f3ccbb6db40fa76a9200022130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035010001910000001a00180000157777772e7363686e6569657266616374732e636f6d00170000ff01000100000a000e000c001d00170018001901000101000b00020100002300000010000e000c02683208687474702f312e310005000501000000000022000a000804030503060302030033006b0069001d00204ca75275f38541b0628d64892200b8b184c7b7fd836b4c8c9b3124e753d7577a00170041040c6eae5febeb82f27d09c5cb7155682da96bf0863aeaff721f556885790a3819449702afd594b8c088aa1ea4effaf210867a0c0e430ad460ffe16847b6d1cbc4002b00050403040303000d0018001604030503060308040805080604010501060102030201002d00020101001c0002400100150081000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"));
392400

393401
List<AbstractRecord> recordListTestRecordContentTypeWithPriority = new LinkedList<>();
394402
EqualityError expectedResultRecordContentTypeWithPriority;
@@ -416,7 +424,8 @@ public static Collection<Object[]> generateData() {
416424

417425
// generate ClientHelloRecord with different Version & different Content
418426
Record clientHelloRecordDiffVersionWithPriority = parseRecord(ProtocolMessageType.HANDSHAKE,
419-
ProtocolVersion.TLS12.getValue(), 512, ArrayConverter.hexStringToByteArray("1603010200010001fc03036ced07c5f0707d08d6c98ab375b523236492233a56eaec0d8feb2565ba7c337720c6b3ba7f6fdf5c643a038d40b56a8db014a6c90359432f3ccbb6db40fa76a9200022130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035010001910000001a00180000157777772e7363686e6569657266616374732e636f6d00170000ff01000100000a000e000c001d00170018001901000101000b00020100002300000010000e000c02683208687474702f312e310005000501000000000022000a000804030503060302030033006b0069001d00204ca75275f38541b0628d64892200b8b184c7b7fd836b4c8c9b3124e753d7577a00170041040c6eae5febeb82f27d09c5cb7155682da96bf0863aeaff721f556885790a3819449702afd594b8c088aa1ea4effaf210867a0c0e430ad460ffe16847b6d1cbc4002b00050403040303000d0018001604030503060308040805080604010501060102030201002d00020101001c0002400100150081000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"));
427+
ProtocolVersion.TLS12.getValue(), 512, ArrayConverter.hexStringToByteArray(
428+
"1603010200010001fc03036ced07c5f0707d08d6c98ab375b523236492233a56eaec0d8feb2565ba7c337720c6b3ba7f6fdf5c643a038d40b56a8db014a6c90359432f3ccbb6db40fa76a9200022130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035010001910000001a00180000157777772e7363686e6569657266616374732e636f6d00170000ff01000100000a000e000c001d00170018001901000101000b00020100002300000010000e000c02683208687474702f312e310005000501000000000022000a000804030503060302030033006b0069001d00204ca75275f38541b0628d64892200b8b184c7b7fd836b4c8c9b3124e753d7577a00170041040c6eae5febeb82f27d09c5cb7155682da96bf0863aeaff721f556885790a3819449702afd594b8c088aa1ea4effaf210867a0c0e430ad460ffe16847b6d1cbc4002b00050403040303000d0018001604030503060308040805080604010501060102030201002d00020101001c0002400100150081000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"));
420429

421430
List<AbstractRecord> recordListTestRecordVersionWithPriority = new LinkedList<>();
422431
EqualityError expectedResultRecordVersionWithPriority;
@@ -460,8 +469,8 @@ public static Collection<Object[]> generateData() {
460469
// Tests with PriorityCheck regarding EqualityError.Record_Content
461470
{ msgListTestClient, recordListTestClient, stateTestClient, msgListTestMsgClassWithPriority,
462471
recordListTestClientWithContentError, stateTestClient, expectedResultMsgClassWithPriority },
463-
// { msgListTestClient, recordListTestClient, stateTestClient, msgListTestMsgContentWithPriority,
464-
// recordListTestClientWithContentError, stateTestClient, expectedResultMsgContentWithPriority },
472+
{ msgListTestServer, recordListTestServer, stateTestServer, msgListTestMsgContent, recordListTestServerWithContentError,
473+
stateTestServer, expectedResultMsgContentWithPriority },
465474
{ msgListTestClient, recordListTestClient, stateTestClient, msgListTestMsgCountWithPriority,
466475
recordListTestClientWithContentError, stateTestClient, expectedResultMsgCountWithPriority },
467476
{ msgListTestClient, recordListTestClient, stateTestClient, msgListTestClient,

0 commit comments

Comments
 (0)