src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java
changeset 52170 2990f1e1c325
parent 51134 a0de9a3a6766
child 52512 1838347a803b
equal deleted inserted replaced
52169:ca48ad1b6e21 52170:2990f1e1c325
   130     private final List<SNIServerName>    requestedServerNames;
   130     private final List<SNIServerName>    requestedServerNames;
   131 
   131 
   132     // Counter used to create unique nonces in NewSessionTicket
   132     // Counter used to create unique nonces in NewSessionTicket
   133     private BigInteger ticketNonceCounter = BigInteger.ONE;
   133     private BigInteger ticketNonceCounter = BigInteger.ONE;
   134 
   134 
       
   135     // The endpoint identification algorithm used to check certificates
       
   136     // in this session.
       
   137     private final String              identificationProtocol;
       
   138 
   135     /*
   139     /*
   136      * Create a new non-rejoinable session, using the default (null)
   140      * Create a new non-rejoinable session, using the default (null)
   137      * cipher spec.  This constructor returns a session which could
   141      * cipher spec.  This constructor returns a session which could
   138      * be used either by a client or by a server, as a connection is
   142      * be used either by a client or by a server, as a connection is
   139      * first opened and before handshaking begins.
   143      * first opened and before handshaking begins.
   147         this.localSupportedSignAlgs = Collections.emptySet();
   151         this.localSupportedSignAlgs = Collections.emptySet();
   148         this.serverNameIndication = null;
   152         this.serverNameIndication = null;
   149         this.requestedServerNames = Collections.<SNIServerName>emptyList();
   153         this.requestedServerNames = Collections.<SNIServerName>emptyList();
   150         this.useExtendedMasterSecret = false;
   154         this.useExtendedMasterSecret = false;
   151         this.creationTime = System.currentTimeMillis();
   155         this.creationTime = System.currentTimeMillis();
       
   156         this.identificationProtocol = null;
   152     }
   157     }
   153 
   158 
   154     /*
   159     /*
   155      * Create a new session, using a given cipher spec.  This will
   160      * Create a new session, using a given cipher spec.  This will
   156      * be rejoinable if session caching is enabled; the constructor
   161      * be rejoinable if session caching is enabled; the constructor
   196                 (hc.handshakeExtensions.get(
   201                 (hc.handshakeExtensions.get(
   197                         SSLExtension.CH_EXTENDED_MASTER_SECRET) != null) &&
   202                         SSLExtension.CH_EXTENDED_MASTER_SECRET) != null) &&
   198                 (!hc.negotiatedProtocol.useTLS13PlusSpec());
   203                 (!hc.negotiatedProtocol.useTLS13PlusSpec());
   199         }
   204         }
   200         this.creationTime = creationTime;
   205         this.creationTime = creationTime;
       
   206         this.identificationProtocol = hc.sslConfig.identificationProtocol;
   201 
   207 
   202         if (SSLLogger.isOn && SSLLogger.isOn("session")) {
   208         if (SSLLogger.isOn && SSLLogger.isOn("session")) {
   203              SSLLogger.finest("Session initialized:  " + this);
   209              SSLLogger.finest("Session initialized:  " + this);
   204         }
   210         }
   205     }
   211     }
   255         return result;
   261         return result;
   256     }
   262     }
   257 
   263 
   258     int getTicketAgeAdd() {
   264     int getTicketAgeAdd() {
   259         return ticketAgeAdd;
   265         return ticketAgeAdd;
       
   266     }
       
   267 
       
   268     String getIdentificationProtocol() {
       
   269         return this.identificationProtocol;
   260     }
   270     }
   261 
   271 
   262     /*
   272     /*
   263      * Get the PSK identity. Take care not to use it in multiple connections.
   273      * Get the PSK identity. Take care not to use it in multiple connections.
   264      */
   274      */