src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java
branchJDK-8145252-TLS13-branch
changeset 56716 38c2a4078033
parent 56702 75527e40bdfd
equal deleted inserted replaced
56715:b152d06ed6a9 56716:38c2a4078033
   259 
   259 
   260             // create and cache the new session
   260             // create and cache the new session
   261             // The new session must be a child of the existing session so
   261             // The new session must be a child of the existing session so
   262             // they will be invalidated together, etc.
   262             // they will be invalidated together, etc.
   263             SSLSessionImpl sessionCopy = new SSLSessionImpl(shc,
   263             SSLSessionImpl sessionCopy = new SSLSessionImpl(shc,
   264                 shc.handshakeSession.getSuite(), newId,
   264                     shc.handshakeSession.getSuite(), newId,
   265                 shc.handshakeSession.getCreationTime());
   265                     shc.handshakeSession.getCreationTime());
   266             shc.handshakeSession.addChild(sessionCopy);
   266             shc.handshakeSession.addChild(sessionCopy);
   267             sessionCopy.setPreSharedKey(psk);
   267             sessionCopy.setPreSharedKey(psk);
   268             sessionCopy.setPskIdentity(newId.getId());
   268             sessionCopy.setPskIdentity(newId.getId());
   269             sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd);
   269             sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd);
   270             sessionCache.put(sessionCopy);
   270             sessionCache.put(sessionCopy);
   373             // create and cache the new session
   373             // create and cache the new session
   374             // The new session must be a child of the existing session so
   374             // The new session must be a child of the existing session so
   375             // they will be invalidated together, etc.
   375             // they will be invalidated together, etc.
   376             SessionId newId =
   376             SessionId newId =
   377                 new SessionId(true, hc.sslContext.getSecureRandom());
   377                 new SessionId(true, hc.sslContext.getSecureRandom());
   378             SSLSessionImpl sessionCopy =
   378             SSLSessionImpl sessionCopy = new SSLSessionImpl(
   379                 new SSLSessionImpl(hc, sessionToSave.getSuite(), newId,
   379                     hc, sessionToSave.getSuite(), newId,
   380                 sessionToSave.getCreationTime());
   380                     sessionToSave.getCreationTime());
   381             sessionToSave.addChild(sessionCopy);
   381             sessionToSave.addChild(sessionCopy);
   382             sessionCopy.setPreSharedKey(psk);
   382             sessionCopy.setPreSharedKey(psk);
   383             sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd);
   383             sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd);
   384             sessionCopy.setPskIdentity(nstm.ticket);
   384             sessionCopy.setPskIdentity(nstm.ticket);
   385             sessionCache.put(sessionCopy);
   385             sessionCache.put(sessionCopy);