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

Ensure calling ReferenceCountedSslEngine.unwrap(...) / wrap(...) can … #6238

Closed
wants to merge 1 commit into
base: 4.1
from

Conversation

Projects
None yet
2 participants
@normanmaurer
Member

normanmaurer commented Jan 18, 2017

…be called after it was closed

Motivation:

SSLEngine allows to have unwrap(...) / wrap(...) called even after closeInbound() and closeOutbound() were called. We need to support the same in ReferenceCountedSslEngine.

Modification:

  • Allow calling ReferenceCountedSslEngine.unwrap(...) / wrap(...) after the engine was closed
  • Modify unit test to ensure correct behaviour.

Result:

Implementation works as expected.

@normanmaurer normanmaurer added the defect label Jan 18, 2017

@normanmaurer normanmaurer added this to the 4.0.44.Final milestone Jan 18, 2017

@normanmaurer normanmaurer self-assigned this Jan 18, 2017

@normanmaurer normanmaurer requested review from nmittler and Scottmitch Jan 18, 2017

@Scottmitch

This comment has been minimized.

Show comment
Hide comment
@Scottmitch

Scottmitch Jan 18, 2017

Member

SSLEngine allows -> The JDK implementation of SSLEngine allows?

Member

Scottmitch commented Jan 18, 2017

SSLEngine allows -> The JDK implementation of SSLEngine allows?

Ensure calling ReferenceCountedSslEngine.unwrap(...) / wrap(...) can …
…be called after it was closed

Motivation:

The JDK implementation of SSLEngine allows to have unwrap(...) / wrap(...) called even after closeInbound() and closeOutbound() were called. We need to support the same in ReferenceCountedSslEngine.

Modification:

- Allow calling ReferenceCountedSslEngine.unwrap(...) / wrap(...) after the engine was closed
- Modify unit test to ensure correct behaviour.

Result:

Implementation works as expected.
@normanmaurer

This comment has been minimized.

Show comment
Hide comment
@normanmaurer

normanmaurer Jan 19, 2017

Member

Cherry-picked into 4.1 (91951a5) and 4.0 (7864dd7)

Member

normanmaurer commented Jan 19, 2017

Cherry-picked into 4.1 (91951a5) and 4.0 (7864dd7)

@normanmaurer normanmaurer deleted the ssl_wrap_unwrap_after_close branch Jan 19, 2017

normanmaurer added a commit that referenced this pull request Jan 20, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].

normanmaurer added a commit that referenced this pull request Jan 20, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].

normanmaurer added a commit that referenced this pull request Jan 20, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].

normanmaurer added a commit that referenced this pull request Jan 21, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].

normanmaurer added a commit that referenced this pull request Jan 21, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].

liuzhengyang pushed a commit to liuzhengyang/netty that referenced this pull request Sep 10, 2017

Ensure calling ReferenceCountedOpenSslEngine.wrap(...) after closeOut…
…bound() was called will not throw an SSLException

Motivation:

PR [#6238] added guards to be able to call wrap(...) / unwrap(...) after the engine was shutdown. Unfortunally one case was missed which is when closeOutbound() was called and produced some data while closeInbound() was not called yet.

Modifications:

Correctly guard against SSLException when closeOutbound() was called, produced data and someone calls wrap(...) after it.

Result:

No more SSLException. Fixes [#6260].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment