Skip to content
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

Return correct value from SSLSession.getPacketSize() when using nativ… #13095

Merged
merged 9 commits into from
Jan 9, 2023

Conversation

normanmaurer
Copy link
Member

@normanmaurer normanmaurer commented Jan 4, 2023

…e SSL implementation

Motivation:

We didnt return the maximum size of SSL packet and tried to calculate it. This didnt work as SSL_max_seal_overhead(...) can only be used to calculate the maximum overhead for when encrypting ourself (and not the remote peer). Because of this we sometimes returned a smaller number then what is possible. This had the affect that when users did use getPacketSize() to size the ByteBuffer we could end up in a situation that would never produce a big enough ByteBuffer and so never finish the handshake.

This issue only accoured when users use the SSLEngine directly. When using our SslHandler we were not affected by this as we use a different approach there.

Modifications:

  • Upgrade netty-tcnative to be able to reuse the the defined constant
  • Add unit test that did loop forever before this change

Result:

Fixes #13073

…e SSL implementation

Motivation:

We didnt return the maximum size of SSL packet and tried to calculate it. This didnt work as SSL_max_seal_overhead(...) can only be used to calculate the maximum overhead for when encrypting ourself (and not the remote peer).
Because of this we sometimes returned a smaller number then what is possible. This had the affect that when users did use getPacketSize() to size the ByteBuffer we could end up in a situation that would never produce a bug enough ByteBuffer and so never finish the handshake.

This issue only accoured when users use the SSLEngine directly. When using our SslHandler we were not affected by this as we use a different approach there.

Modifications:

- Upgrade netty-tcnative to be able to reuse the the defined constant
- Add unit test that did loop forever before this change

Result:

Fixes #13073
@normanmaurer normanmaurer added this to the 4.1.87.Final milestone Jan 4, 2023
@normanmaurer normanmaurer merged commit e530cd6 into 4.1 Jan 9, 2023
@normanmaurer normanmaurer deleted the packetsize_fix branch January 9, 2023 08:48
normanmaurer added a commit that referenced this pull request Jan 9, 2023
…ve SSL implementation (#13095)

Motivation:

We didnt return the maximum size of SSL packet and tried to calculate it. This didnt work as SSL_max_seal_overhead(...) can only be used to calculate the maximum overhead for when encrypting ourself (and not the remote peer).
Because of this we sometimes returned a smaller number then what is possible. This had the affect that when users did use getPacketSize() to size the ByteBuffer we could end up in a situation that would never produce a bug enough ByteBuffer and so never finish the handshake.

This issue only accoured when users use the SSLEngine directly. When using our SslHandler we were not affected by this as we use a different approach there.

Modifications:

- Upgrade netty-tcnative to be able to reuse the the defined constant
- Add unit test that did loop forever before this change

Result:

Fixes #13073
lhotari added a commit to lhotari/pulsar that referenced this pull request Feb 3, 2023
- Brings Netty Tcnative 2.0.56.Final
- Also upgraded Netty's io_uring support to a compatible version

Release notes:
https://netty.io/news/2023/01/12/4-1-87-Final.html
https://netty.io/news/2023/02/02/multiple_releases_incubator.html

Some relevant Netty bug fixes:

Improves compatibility with newer Linux distros:
netty/netty#13112

TLS 1.3 handshake issue fix:
netty/netty#13073 fixed by netty/netty#13095
lhotari added a commit to lhotari/bookkeeper that referenced this pull request Feb 3, 2023
- Brings Netty Tcnative 2.0.56.Final
- Also upgraded Netty's io_uring support to a compatible version

Release notes:
https://netty.io/news/2023/01/12/4-1-87-Final.html
https://netty.io/news/2023/02/02/multiple_releases_incubator.html

Some relevant Netty bug fixes:

Improves compatibility with newer Linux distros:
netty/netty#13112

TLS 1.3 handshake issue fix:
netty/netty#13073 fixed by netty/netty#13095
nicoloboschi pushed a commit to apache/bookkeeper that referenced this pull request Feb 10, 2023
- Brings Netty Tcnative 2.0.56.Final
- Also upgraded Netty's io_uring support to a compatible version

Release notes:
https://netty.io/news/2023/01/12/4-1-87-Final.html
https://netty.io/news/2023/02/02/multiple_releases_incubator.html

Some relevant Netty bug fixes:

Improves compatibility with newer Linux distros:
netty/netty#13112

TLS 1.3 handshake issue fix:
netty/netty#13073 fixed by netty/netty#13095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenSslEngine fails the TLSv1.3 handshake in some configurations
2 participants