GeezerVison is showing github.com — Support read-only input buffers in SslHandler by lhotari · Pull Request #14079 · netty/netty
Conversation
lhotari
commented
May 24, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation:
JDK SSLEngine unwrap (& wrap) fails on read-only input ByteBuffer.
Modification:
- add
wantsMutableBuffer to SslEngineType and set this to true for the JDK SslEngineType
- Although JDK >= 19 supports read-only buffers, always check for read-only buffers and make copies when the JDK SslEngineType is used.
- make changes to SslHandlerCoalescingBufferQueue to always return a copy if the buffer to return is read-only
- add changes to SslHandler.wrap to handle the case where a read-only nio buffer might have been included in a composite buffer. In that case copying is needed at that stage if
wantsMutableBuffer is true.
Result:
Fixes #14069
other PRs relevant in fixing #14069 are #14072, #14071, #14076 and #14078
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lhotari
changed the title
[WIP] Make a copy of a read-only buffer before passing to SSLEngine.wrap
Support read-only input buffers in SslHandler
May 25, 2024
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
I added an integration test in be948fa and couldn't reproduce any issues even when the changes weren't present.
The JDK issues are about unwrap. I was assuming that this would also apply to wrap. That doesn't seem to be the case.
It looks like the unwrap mutatation issue was handled by #12213.
For supporting the read-only input buffers use case, it looks like PRs #14072, #14071, #14076 and #14078 are sufficient.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.