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

SSLEngine fixes for session cache, getError(), and unwrap() HandshakeStatus #193

Merged
merged 7 commits into from
May 22, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented May 16, 2024

This PR includes the following fixes to SSLEngine:

  • Only save the client session (WOLFSSL_SESSION) to the cache if the handshake has finished successfully and there is no outstanding error from wolfSSL_get_error() / getError(). This may prevent subsequent session resumption attempts trying to load/use a session that was in an error state.
  • Synchronize calls to wolfSSL_get_error() / getError() with ioLock in case WOLFSSL state is changing. We want to prevent getting an error until activity is done/paused on the session.

This PR also fixes some issues found while testing wolfJSSE against the SunJSSE SSLEngine tests, including:

  • Correctly return SSL_SUCCESS from WolfSSLEngine.ClosingConnection() when ZERO_RETURN is received
  • Correctly return HandshakeStatus.FINISHED from SSLEngine.unwrap() when a client has received a TLS 1.3 session ticket from the peer. This necessitated also wrapping the native wolfSSL API wolfSSL_SESSION_has_ticket().

ZD 17962

@cconlon cconlon self-assigned this May 16, 2024
@JacobBarthelmeh JacobBarthelmeh merged commit 2353670 into wolfSSL:master May 22, 2024
35 checks passed
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.

3 participants