8277970: Test jdk/sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java fails with "tag mismatch"

Reviewed-by: jnimeh, xuelei
This commit is contained in:
Daniel Jeliński 2022-10-12 15:32:36 +00:00
parent 0475c34120
commit d1252653b0
3 changed files with 8 additions and 3 deletions

View file

@ -255,7 +255,11 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord {
// Decrypt the fragment
//
ByteBuffer fragment;
recordLock.lock();
try {
if (isClosed) {
return null;
}
Plaintext plaintext =
readCipher.decrypt(contentType, recordBody, null);
fragment = plaintext.fragment;
@ -264,6 +268,8 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord {
throw bpe;
} catch (GeneralSecurityException gse) {
throw new SSLProtocolException("Unexpected exception", gse);
} finally {
recordLock.unlock();
}
if (contentType != ContentType.HANDSHAKE.id &&