<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Daniel,
<div class=""><br class="">
</div>
<div class="">Thank you for the nice catch! I filed a JBS bug: </div>
<div class=""> <a href="https://bugs.openjdk.java.net/browse/JDK-8275811" class="">https://bugs.openjdk.java.net/browse/JDK-8275811</a></div>
<div class=""><br class="">
</div>
<div class="">It would be nice if you could also update similar issues in (DTLS)OutRecord files.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Xuelei<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Oct 22, 2021, at 8:14 AM, Daniel JeliĆski <<a href="mailto:djelinski1@gmail.com" class="">djelinski1@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi all,<br class="">
During routine examination of thread dumps I noticed a stack trace you<br class="">
may find interesting. Relevant part:<br class="">
<br class="">
java.lang.Thread.State: RUNNABLE<br class="">
...<br class="">
at java.lang.IllegalStateException.<init>(java.base@11.0.11/Unknown Source)<br class="">
at javax.crypto.Cipher.checkCipherState(java.base@11.0.11/Unknown Source)<br class="">
at javax.crypto.Cipher.doFinal(java.base@11.0.11/Unknown Source)<br class="">
at sun.security.ssl.SSLCipher$T12GcmReadCipherGenerator$GcmReadCipher.dispose(java.base@11.0.11/Unknown<br class="">
Source)<br class="">
at sun.security.ssl.InputRecord.changeReadCiphers(java.base@11.0.11/Unknown<br class="">
Source)<br class="">
at sun.security.ssl.ChangeCipherSpec$T10ChangeCipherSpecConsumer.consume(java.base@11.0.11/Unknown<br class="">
Source)<br class="">
...<br class="">
<br class="">
All handshakes that negotiate GCM ciphers throw and catch an<br class="">
exception, because the newly created cipher is disposed before use.<br class="">
<br class="">
I believe this is caused by this line of code:<br class="">
<a href="https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.base/share/classes/sun/security/ssl/InputRecord.java#L125" class="">https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.base/share/classes/sun/security/ssl/InputRecord.java#L125</a><br class="">
<br class="">
I think it should read as follows:<br class="">
this.readCipher.dispose();<br class="">
<br class="">
I can file a PR, just need help with JBS ID.<br class="">
Regards,<br class="">
Daniel<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>