8210334: TLS 1.3 server fails if ClientHello doesn't have pre_shared_key and psk_key_exchange_modes
authorxuelei
Wed, 05 Sep 2018 21:01:39 -0700
changeset 51654 b6ccd982e33d
parent 51653 b51d348698c2
child 51655 0f921a6707d9
8210334: TLS 1.3 server fails if ClientHello doesn't have pre_shared_key and psk_key_exchange_modes Reviewed-by: ascarpino, wetmore
src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java
--- a/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java	Wed Sep 05 19:40:52 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java	Wed Sep 05 21:01:39 2018 -0700
@@ -323,7 +323,7 @@
             // servers MUST abort the handshake.
             SSLExtensionSpec spec =
                 shc.handshakeExtensions.get(SSLExtension.CH_PRE_SHARED_KEY);
-            if (spec == null) {
+            if (spec != null) {
                 shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "pre_shared_key key extension is offered " +
                         "without a psk_key_exchange_modes extension");