mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8241248: NullPointerException in sun.security.ssl.HKDF.extract(HKDF.java:93)
Reviewed-by: jnimeh, xuelei
This commit is contained in:
parent
0f925d1f58
commit
1603ca2342
4 changed files with 42 additions and 5 deletions
|
@ -372,9 +372,11 @@ final class PreSharedKeyExtension {
|
|||
SSLSessionImpl s = null;
|
||||
|
||||
for (PskIdentity requestedId : pskSpec.identities) {
|
||||
// If we are keeping state, see if the identity is in the cache
|
||||
// If we are keeping state, see if the identity is in the
|
||||
// cache. Note that for TLS 1.3, we would also clean
|
||||
// up the cached session if it is not rejoinable.
|
||||
if (requestedId.identity.length == SessionId.MAX_LENGTH) {
|
||||
s = sessionCache.get(requestedId.identity);
|
||||
s = sessionCache.pull(requestedId.identity);
|
||||
}
|
||||
// See if the identity is a stateless ticket
|
||||
if (s == null &&
|
||||
|
|
|
@ -175,6 +175,15 @@ final class SSLSessionContextImpl implements SSLSessionContext {
|
|||
return (SSLSessionImpl)getSession(id);
|
||||
}
|
||||
|
||||
// package-private method, find and remove session from cache
|
||||
// return found session
|
||||
SSLSessionImpl pull(byte[] id) {
|
||||
if (id != null) {
|
||||
return sessionCache.pull(new SessionId(id));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// package-private method, used ONLY by ClientHandshaker
|
||||
SSLSessionImpl get(String hostname, int port) {
|
||||
/*
|
||||
|
|
|
@ -560,9 +560,6 @@ final class ServerHello {
|
|||
|
||||
setUpPskKD(shc,
|
||||
shc.resumingSession.consumePreSharedKey());
|
||||
|
||||
// The session can't be resumed again---remove it from cache
|
||||
sessionCache.remove(shc.resumingSession.getSessionId());
|
||||
}
|
||||
|
||||
// update the responders
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue