Skip to content

Commit 64d5cc6

Browse files
authored
Merge pull request #547 from RUB-NDS/scanFixes
Scan fixes
2 parents 0a176ae + b89b3a7 commit 64d5cc6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/actions/EarlyCcsAction.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
import de.rub.nds.tlsattacker.core.workflow.action.TlsAction;
2121
import de.rub.nds.tlsattacker.core.workflow.factory.WorkflowConfigurationFactory;
2222
import java.io.IOException;
23+
import java.net.SocketException;
2324
import java.util.LinkedList;
2425
import java.util.List;
26+
import org.apache.logging.log4j.LogManager;
27+
import org.apache.logging.log4j.Logger;
2528

2629
/**
2730
* This Action is used by the EarlyCcs Attack. It sends a ClientKeyExchange
@@ -30,8 +33,12 @@
3033
*/
3134
public class EarlyCcsAction extends TlsAction {
3235

36+
private static final Logger LOGGER = LogManager.getLogger();
37+
3338
private final Boolean targetOpenssl1_0_0;
3439

40+
private boolean executedAsPlanned = false;
41+
3542
/**
3643
* Constructor for the Action. If the target is Openssl 1.0.0 the boolean
3744
* value should be set to true
@@ -76,8 +83,15 @@ public void execute(State state) throws IOException {
7683
recordList.add(new Record());
7784
byte[] prepareRecords = state.getTlsContext().getRecordLayer()
7885
.prepareRecords(protocolMessageBytes, ProtocolMessageType.HANDSHAKE, recordList);
79-
state.getTlsContext().getTransportHandler().sendData(prepareRecords);
86+
try {
87+
state.getTlsContext().getTransportHandler().sendData(prepareRecords);
88+
executedAsPlanned = true;
89+
} catch (SocketException E) {
90+
LOGGER.debug("Could not write Data to stream", E);
91+
executedAsPlanned = false;
92+
}
8093
setExecuted(true);
94+
8195
}
8296

8397
/**
@@ -86,11 +100,12 @@ public void execute(State state) throws IOException {
86100
@Override
87101
public void reset() {
88102
setExecuted(false);
103+
executedAsPlanned = false;
89104
}
90105

91106
@Override
92107
public boolean executedAsPlanned() {
93-
return isExecuted();
108+
return executedAsPlanned;
94109
}
95110

96111
}

0 commit comments

Comments
 (0)