Skip to content

Commit 7eecfa9

Browse files
committed
Added check to see if the Workflow could get executed
1 parent 20bd888 commit 7eecfa9

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/impl/BleichenbacherAttacker.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ private EqualityError isVulnerable(BleichenbacherWorkflowType bbWorkflowType, Li
8787
List<ResponseFingerprint> responseFingerprintList = new LinkedList<>();
8888
for (Pkcs1Vector pkcs1Vector : pkcs1Vectors) {
8989
State state = executeTlsFlow(bbWorkflowType, pkcs1Vector.getEncryptedValue());
90-
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
90+
if (state.getWorkflowTrace().allActionsExecuted()) {
91+
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
92+
responseFingerprintList.add(fingerprint);
93+
} else {
94+
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
95+
}
9196
clearConnections(state);
92-
responseFingerprintList.add(fingerprint);
9397
}
9498
if (responseFingerprintList.isEmpty()) {
9599
LOGGER.warn("Could not extract Fingerprints");

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/impl/PaddingOracleAttacker.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,21 @@ public Boolean isVulnerable() {
179179
LOGGER.warn("TLS-Attacker failed execute a Handshake. Skipping to next record");
180180
continue;
181181
}
182-
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
183-
clearConnections(state);
184-
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
185-
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
186-
int length = ((Record) lastRecord).getLength().getValue();
187-
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
188-
if (responseFingerprintList == null) {
189-
responseFingerprintList = new LinkedList<>();
190-
responseMap.put(length, responseFingerprintList);
182+
if (state.getWorkflowTrace().allActionsExecuted()) {
183+
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
184+
clearConnections(state);
185+
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
186+
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
187+
int length = ((Record) lastRecord).getLength().getValue();
188+
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
189+
if (responseFingerprintList == null) {
190+
responseFingerprintList = new LinkedList<>();
191+
responseMap.put(length, responseFingerprintList);
192+
}
193+
responseFingerprintList.add(fingerprint);
194+
} else {
195+
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
191196
}
192-
responseFingerprintList.add(fingerprint);
193197

194198
}
195199
LOGGER.log(LogLevel.CONSOLE_OUTPUT,

0 commit comments

Comments
 (0)