< prev index next >

src/share/classes/sun/security/ssl/ClientHandshaker.java

Print this page
rev 13714 : 8218580: endpoint identification algorithm should be case-insensitive
Reviewed-by: jnimeh
   1 /*
   2  * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


1382                             // The extended master secret extension does not
1383                             // apply to SSL 3.0.  Perform a full handshake
1384                             // instead.
1385                             //
1386                             // Note that the useExtendedMasterSecret is
1387                             // extended to protect SSL 3.0 connections,
1388                             // by discarding abbreviate handshake.
1389                             session = null;
1390                         }
1391                     }
1392                 }
1393             }
1394 
1395             // ensure that the endpoint identification algorithm matches the
1396             // one in the session
1397             String identityAlg = getEndpointIdentificationAlgorithmSE();
1398             if (session != null && identityAlg != null) {
1399 
1400                 String sessionIdentityAlg =
1401                     session.getEndpointIdentificationAlgorithm();
1402                 if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
1403 
1404                     if (debug != null && Debug.isOn("session")) {
1405                         System.out.println("%% can't resume, endpoint id" +
1406                             " algorithm does not match, requested: " +
1407                             identityAlg + ", cached: " + sessionIdentityAlg);
1408                     }
1409                     session = null;
1410                 }
1411             }
1412 
1413             if (session != null) {
1414                 if (debug != null) {
1415                     if (Debug.isOn("handshake") || Debug.isOn("session")) {
1416                         System.out.println("%% Try resuming " + session
1417                             + " from port " + getLocalPortSE());
1418                     }
1419                 }
1420 
1421                 sessionId = session.getSessionId();
1422                 maxProtocolVersion = sessionVersion;


   1 /*
   2  * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


1382                             // The extended master secret extension does not
1383                             // apply to SSL 3.0.  Perform a full handshake
1384                             // instead.
1385                             //
1386                             // Note that the useExtendedMasterSecret is
1387                             // extended to protect SSL 3.0 connections,
1388                             // by discarding abbreviate handshake.
1389                             session = null;
1390                         }
1391                     }
1392                 }
1393             }
1394 
1395             // ensure that the endpoint identification algorithm matches the
1396             // one in the session
1397             String identityAlg = getEndpointIdentificationAlgorithmSE();
1398             if (session != null && identityAlg != null) {
1399 
1400                 String sessionIdentityAlg =
1401                     session.getEndpointIdentificationAlgorithm();
1402                 if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) {
1403 
1404                     if (debug != null && Debug.isOn("session")) {
1405                         System.out.println("%% can't resume, endpoint id" +
1406                             " algorithm does not match, requested: " +
1407                             identityAlg + ", cached: " + sessionIdentityAlg);
1408                     }
1409                     session = null;
1410                 }
1411             }
1412 
1413             if (session != null) {
1414                 if (debug != null) {
1415                     if (Debug.isOn("handshake") || Debug.isOn("session")) {
1416                         System.out.println("%% Try resuming " + session
1417                             + " from port " + getLocalPortSE());
1418                     }
1419                 }
1420 
1421                 sessionId = session.getSessionId();
1422                 maxProtocolVersion = sessionVersion;


< prev index next >