Skip to content

Commit 5309cf1

Browse files
committed
Made scanner more robust
1 parent fa311d7 commit 5309cf1

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

src/main/java/de/rub/nds/tlsscanner/probe/BleichenbacherProbe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public ProbeResult executeTest() {
4444
RSAPublicKey publicKey = (RSAPublicKey) CertificateFetcher.fetchServerPublicKey(bleichenbacherConfig.createConfig());
4545
if (publicKey == null) {
4646
LOGGER.info("Could not retrieve PublicKey from Server - is the Server running?");
47-
return null;
47+
return getNotExecutedResult();
4848
}
4949
LOGGER.info("Fetched the following server public key: " + publicKey);
5050
List<Pkcs1Vector> pkcs1Vectors;

src/main/java/de/rub/nds/tlsscanner/probe/PaddingOracleProbe.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ public ProbeResult executeTest() {
122122
lastResult = null;
123123
hasError = true;
124124
}
125+
if (attacker.isErrornousScans()) {
126+
hasError = true;
127+
}
125128
for (VectorResponse vectorResponse : attacker.getVectorResponseList()) {
126129
if (vectorResponse.isErrorDuringHandshake()) {
127130
hasError = true;

src/main/java/de/rub/nds/tlsscanner/probe/TlsProbe.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,23 @@ public ProbeResult call() {
6969
long startTime = System.currentTimeMillis();
7070
ProbeResult result = executeTest();
7171
long stopTime = System.currentTimeMillis();
72-
result.setStarttime(startTime);
73-
result.setStoptime(stopTime);
74-
LOGGER.info("Finished " + getProbeName() + " - Took " + (stopTime - startTime) / 1000 + "s");
72+
if (result != null) {
73+
result.setStarttime(startTime);
74+
result.setStoptime(stopTime);
75+
} else {
76+
LOGGER.warn("" + getProbeName() + " - is null result");
77+
}
78+
79+
LOGGER.info(
80+
"Finished " + getProbeName() + " - Took " + (stopTime - startTime) / 1000 + "s");
7581
return result;
7682
}
7783

7884
public final void executeState(State... states) {
79-
this.executeState(new ArrayList<State>(Arrays.asList(states)));
85+
this.executeState(new ArrayList<State>(Arrays
86+
.asList(states
87+
)));
88+
8089
}
8190

8291
public final void executeState(List<State> states) {
@@ -87,19 +96,24 @@ public final void executeState(List<State> states) {
8796

8897
}
8998

90-
public abstract ProbeResult executeTest();
99+
public abstract ProbeResult
100+
executeTest();
91101

92-
public abstract boolean shouldBeExecuted(SiteReport report);
102+
public abstract boolean shouldBeExecuted(SiteReport report
103+
);
93104

94-
public abstract void adjustConfig(SiteReport report);
105+
public abstract void adjustConfig(SiteReport report
106+
);
95107

96108
public abstract ProbeResult getNotExecutedResult();
97109

98110
public ParallelExecutor getParallelExecutor() {
99111
return parallelExecutor;
112+
100113
}
101114

102115
public StatsWriter getWriter() {
103116
return writer;
117+
104118
}
105119
}

0 commit comments

Comments
 (0)