File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/protocol Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1111import de .rub .nds .modifiablevariable .util .ArrayConverter ;
1212import de .rub .nds .tlsattacker .core .constants .AlgorithmResolver ;
1313import de .rub .nds .tlsattacker .core .constants .DigestAlgorithm ;
14+ import de .rub .nds .tlsattacker .core .constants .ExtensionType ;
1415import de .rub .nds .tlsattacker .core .constants .HKDFAlgorithm ;
1516import de .rub .nds .tlsattacker .core .constants .Tls13KeySetType ;
1617import 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 }
Original file line number Diff line number Diff line change @@ -131,9 +131,6 @@ public ClientHelloMessage(Config tlsConfig) {
131131 if (tlsConfig .isAddPSKKeyExchangeModesExtension ()) {
132132 addExtension (new PSKKeyExchangeModesExtensionMessage (tlsConfig ));
133133 }
134- if (tlsConfig .isAddPreSharedKeyExtension ()) {
135- addExtension (new PreSharedKeyExtensionMessage (tlsConfig ));
136- }
137134 if (tlsConfig .isAddExtendedMasterSecretExtension ()) {
138135 addExtension (new ExtendedMasterSecretExtensionMessage ());
139136 }
@@ -200,6 +197,10 @@ public ClientHelloMessage(Config tlsConfig) {
200197 if (tlsConfig .isAddCertificateStatusRequestV2Extension ()) {
201198 addExtension (new CertificateStatusRequestV2ExtensionMessage ());
202199 }
200+ if (tlsConfig .isAddPreSharedKeyExtension ()) {
201+ addExtension (new PreSharedKeyExtensionMessage (tlsConfig ));
202+ }
203+ // In TLS 1.3, the PSK ext has to be the last ClientHello extension
203204 }
204205
205206 public ModifiableInteger getCompressionLength () {
You can’t perform that action at this time.
0 commit comments