Skip to content

Commit 5c9912d

Browse files
committed
Switch client secrets here if we're not using 0RTT
1 parent 002bcf9 commit 5c9912d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/protocol/handler/FinishedHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import de.rub.nds.modifiablevariable.util.ArrayConverter;
1212
import de.rub.nds.tlsattacker.core.constants.AlgorithmResolver;
1313
import de.rub.nds.tlsattacker.core.constants.DigestAlgorithm;
14+
import de.rub.nds.tlsattacker.core.constants.ExtensionType;
1415
import de.rub.nds.tlsattacker.core.constants.HKDFAlgorithm;
1516
import de.rub.nds.tlsattacker.core.constants.Tls13KeySetType;
1617
import de.rub.nds.tlsattacker.core.crypto.HKDFunction;
@@ -60,7 +61,8 @@ public void adjustTLSContext(FinishedMessage message) {
6061
} else {
6162
setClientRecordCipher(Tls13KeySetType.APPLICATION_TRAFFIC_SECRETS);
6263
}
63-
} else if (tlsContext.getChooser().getConnectionEndType() == ConnectionEndType.CLIENT) {
64+
} else if (tlsContext.getChooser().getConnectionEndType() == ConnectionEndType.CLIENT
65+
|| tlsContext.isExtensionNegotiated(ExtensionType.EARLY_DATA) == false) {
6466
setClientRecordCipher(Tls13KeySetType.HANDSHAKE_TRAFFIC_SECRETS);
6567
}
6668
}

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/protocol/message/ClientHelloMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ public ClientHelloMessage(Config tlsConfig) {
199199
}
200200
if (tlsConfig.isAddPreSharedKeyExtension()) {
201201
addExtension(new PreSharedKeyExtensionMessage(tlsConfig));
202-
}
203-
//In TLS 1.3, the PSK ext has to be the last ClientHello extension
202+
}
203+
// In TLS 1.3, the PSK ext has to be the last ClientHello extension
204204
}
205205

206206
public ModifiableInteger getCompressionLength() {

0 commit comments

Comments
 (0)