-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8350830: Values converted incorrectly when reading TLS session tickets #24535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back nibjen! A progress list of the required criteria for merging this PR into |
@nibjen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 608 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@djelinski, @ascarpino) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
|
||
import javax.net.ssl.*; | ||
import javax.net.ssl.SSLEngineResult.HandshakeStatus; | ||
import java.io.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: wildcard import
test/jdk/sun/security/ssl/SSLSessionImpl/ResumeClientTLS12withSNI.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Here's a +1 from me, but please wait for the usual reviewers.
/reviewers 2 reviewer
|
@djelinski |
I will look at this.. At the time I wrote this I avoided using Record for a reason, but I don't remember why right now. |
@ascarpino @jnimeh since I am waiting for one more review, can you please review it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good. When stateless was integrated, I remember seeing a problem with Record
, but at least from your changes I don't see that problem here. I'm assuming you have tested this change with jdk_security1, 2, 3, and 4?
Thanks @ascarpino. Yes I have run/verified for all tiers explicitly. |
/integrate |
/sponsor |
Going to push as commit 2c1eb33.
Your commit was automatically rebased without conflicts. |
@djelinski @nibjen Pushed as commit 2c1eb33. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Session resumption without server side state was added under JDK-8211018.
While it is TLSv1.2 session resumption, the client hello message is being parsed in SSLSessionImpl for each extensions.
Customer has reported handshake failure and is reproducible locally with exception NegativeArraySizeExceptions when there is ServerNameIndication with size > 127.
According to RFC 3546, the host_name limit allowed is 255.
With a sample testcase when the host_name length is > 127, exception is thrown:
javax.net.ssl|DEBUG|71|Thread-1|2025-04-06 17:13:07.278 UTC|ClientHello.java:825|Negotiated protocol version: TLSv1.2
javax.net.ssl|WARNING|71|Thread-1|2025-04-06 17:13:07.281 UTC|SSLSocketImpl.java:1672|handling exception (
"throwable" : {
java.lang.NegativeArraySizeException: -1
at java.base/sun.security.ssl.SSLSessionImpl.(SSLSessionImpl.java:399)
at java.base/sun.security.ssl.SessionTicketExtension$T12CHSessionTicketConsumer.consume(SessionTicketExtension.java:468)
e.g.
int l = buf.get();
b = new byte[l]; <-------------------- NegativeArraySizeException thrown here when > 127
For TLSv1.3, its not an issue until length > 255.
According to RFC 5077, PSK identity length allowed is <0..2^16-1> and so its value conversion being taken care of under this change.
Master secret is allowed for 48 bytes - master_secret[48], shouldnt be an issue.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24535/head:pull/24535
$ git checkout pull/24535
Update a local copy of the PR:
$ git checkout pull/24535
$ git pull https://git.openjdk.org/jdk.git pull/24535/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24535
View PR using the GUI difftool:
$ git pr show -t 24535
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24535.diff
Using Webrev
Link to Webrev Comment