8218580: endpoint identification algorithm should be case-insensitive
authorxuelei
Fri, 08 Feb 2019 10:03:07 -0800
changeset 53708 c34acb3a3330
parent 53707 67537bbafd7f
child 53709 2b64ebacce93
8218580: endpoint identification algorithm should be case-insensitive Reviewed-by: jnimeh
src/java.base/share/classes/sun/security/ssl/ClientHello.java
src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java
--- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java	Fri Feb 08 09:41:45 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java	Fri Feb 08 10:03:07 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -519,7 +519,7 @@
             if (session != null && identityAlg != null) {
                 String sessionIdentityAlg =
                     session.getIdentificationProtocol();
-                if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+                if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) {
                     if (SSLLogger.isOn &&
                     SSLLogger.isOn("ssl,handshake,verbose")) {
                         SSLLogger.finest("Can't resume, endpoint id" +
@@ -1036,7 +1036,7 @@
                 if (resumingSession && identityAlg != null) {
                     String sessionIdentityAlg =
                         previous.getIdentificationProtocol();
-                    if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+                    if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) {
                         if (SSLLogger.isOn &&
                         SSLLogger.isOn("ssl,handshake,verbose")) {
                             SSLLogger.finest("Can't resume, endpoint id" +
--- a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java	Fri Feb 08 09:41:45 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java	Fri Feb 08 10:03:07 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -458,7 +458,7 @@
         String identityAlg = shc.sslConfig.identificationProtocol;
         if (result && identityAlg != null) {
             String sessionIdentityAlg = s.getIdentificationProtocol();
-            if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+            if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) {
                 if (SSLLogger.isOn &&
                     SSLLogger.isOn("ssl,handshake,verbose")) {