GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Server based TLS-Session-Resumption by marvin-enthus · Pull Request #141 · bcgit/bc-java

Conversation

@marvin-enthus

@marvin-enthus marvin-enthus commented Apr 22, 2016

Copy link
Copy Markdown
Contributor

Hi,

with this pull request we would provide server-based TLS session caching and resumption. The code for handling the session resumption is within TlsServerProtocol.java, but there is no default session management. This has to be provided by an extra TlsServer implementation that handles the getResumableSession(byte[] sessionID) and getNewResumableSession(byte[] requestedClientSessionID) accordingly.

For the implementation following changes have been done:

  • TlsServer.java / AbstractTlsServer.java:
    Introduced two new methods for session resumption and session creation. TlsServer.java defines the methods, AbstractTlsServer.java implements two placeholders that just fulfil the interface requirements but don't do anything...

    The methods are:

    • public TlsSession getResumableSession(byte[] sessionID) throws IOException
    • public TlsSession getNewResumableSession(byte[] requestedClientSessionID)
  • TlsServerProtocol.java:
    Here is most of the work done:
    class level:

    • New class variable to hold the session ID requested by the client

    handleHandshakeMessage():

    • during HandshakeType.client_hello / CS_START: it is checked if we are resuming a session and if yes we do the appropriate handshake flow for a resumed session.
    • during HandshakeType.finished / CS_SERVER_FINISHED: Do the rest of the resume session workflow.

    receiveClientHelloMessage():

    • save the client's requested session ID to the class variable
    • Ask the TlsServer if there is an existing session for this session ID
    • If yes, set the flag that we are resuming the session
    • Implemented some of the RFC 5246 TODO's

    sendServerHelloMessage()

    • send back the client's sessionID if we are resuming or ask the TlsServer for a new session ID if we have no session or the session is not resumable
    • moved some common things (prfAlgorithm decision, verifyDataLength & applyMaxFragmentLengthExtension()) to an earlier position
    • If we are doing a session resumption stop before building and seding server extensions - RFC 3546 sais during resumption the server hello doesn't hold any extensions.
  • SessionParameters.java (with related changes in TlsClientProtocol.java and DTLSClientProtocol.java):
    Refactored encodedServerExtension to encodedPeerExtensions because in this case it holds the client extensions...

  • TlsProtocol.java:
    Fill SessionParameters.java accordingly depending if server or client...

We tested session resumption against Linux (OpenSSL), Mac OSX and Microsoft clients and it works in our scenarios. We hope this pull request will be included in the main stream.

If there are questions or comments just ask ;)

bye,
Chris

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mondain and aberenguel reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@peterdettman peterdettman self-assigned this Apr 25, 2016
@marvin-enthus

marvin-enthus commented Dec 1, 2016

Copy link
Copy Markdown
Contributor Author

I just updated this pull request. We discovered that some RFC 3546 statements about TLS hello extensions handling during resumption have been misleading. Some other RFC's define explicit handling for some extensions during resumption, so we adopted it. It was discovered by problems with the latest version of Apple's coreTLS. It seems neither OpenSSL nor Microsoft's implementations take care of it...

@peterdettman you self-assigned this to you. Any thoughts on this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marvin-enthus added 3 commits December 22, 2017 11:39
@marvin-enthus
Implemented server based TLS-Session-Resumption
5413281
@marvin-enthus
TlsServerProtocol.java: calling applyMaxFragmentLengthExtension() to …
cd81ea0
…early breaks TLS communication when handshake messages exceeds ~ 1500 bytes.
@marvin-enthus
TlsServerProtocol.java - Session Resumption - RFC 3546 saied client /…
09d79f1
… server extensions are irrelevant during resumption, but RFC 7627 and RFC 5746 define special handlings for some extensions during session resumption
@marvin-enthus
marvin-enthus force-pushed the server-session-resumption branch from 004dd67 to 09d79f1 Compare December 22, 2017 10:40
@marvin-enthus

marvin-enthus commented Dec 22, 2017

Copy link
Copy Markdown
Contributor Author

Hi. I've just rebased this PR to the master to resolve the conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sn-pos added a commit to eID-Testbeds/bc-tls-patched that referenced this pull request Apr 5, 2018
@sn-pos
- Imported pull request bcgit/bc-java#141
dbcddb8
- Added support for session resumption via Session Ticket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@peterdettman peterdettman

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@marvin-enthus @peterdettman
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.