Skip to content

Commit d9dd4bb

Browse files
authored
patch for timing transport (#896)
* Made Timing Attacks functional again
1 parent e7eb705 commit d9dd4bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Transport/src/main/java/de/rub/nds/tlsattacker/transport/tcp/proxy/TimingProxyClientTcpTransportHandler.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
import java.net.InetSocketAddress;
1919
import java.net.Socket;
2020
import java.nio.ByteBuffer;
21+
import org.apache.logging.log4j.LogManager;
22+
import org.apache.logging.log4j.Logger;
2123

2224
public class TimingProxyClientTcpTransportHandler extends ClientTcpTransportHandler
2325
implements ProxyableTransportHandler, TimeableTransportHandler {
2426

27+
private static final Logger LOGGER = LogManager.getLogger();
28+
2529
protected Socket controlSocket;
2630
protected String proxyDataHostName = "127.0.0.1";
2731
protected int proxyDataPort = 4444;
@@ -51,7 +55,6 @@ public byte[] fetchData() throws IOException {
5155
throw new IOException("Should return 64 bit unsigned int");
5256
}
5357
measurement = ByteBuffer.wrap(controlData).getLong();
54-
5558
}
5659
return data;
5760
}
@@ -83,12 +86,13 @@ public void initialize() throws IOException {
8386
controlSocket = new Socket();
8487
controlSocket.connect(new InetSocketAddress(proxyControlHostName, proxyControlPort), (int) connectionTimeout);
8588
cachedSocketState = null;
86-
super.initialize();
87-
8889
/* tell the proxy where the real server is */
8990
controlSocket.getOutputStream().write((hostname + "\n").getBytes());
9091
controlSocket.getOutputStream().write((Integer.toString(dstPort) + "\n").getBytes());
9192
controlSocket.getOutputStream().flush();
93+
hostname = proxyDataHostName;
94+
dstPort = proxyDataPort;
95+
super.initialize();
9296
}
9397

9498
@Override

0 commit comments

Comments
 (0)