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

Add server/client handshake #138

Closed
chipsenkbeil opened this issue Sep 15, 2022 · 2 comments
Closed

Add server/client handshake #138

chipsenkbeil opened this issue Sep 15, 2022 · 2 comments
Labels
breaking Would require breaking changes enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

We need this for a couple of reasons:

  1. Provide the client the ability to pick the compression and encryption it wants to use from those made available by the server. Upon receiving a selection, the server would generate the appropriate codecs to support this.
  2. Replay missed messages similar to Eternal Terminal's backed reader and writer. On handshake, the client and server would send each other any missed messages

For the first reason, we may want to implement discriminants for CompressionCodec and possibly merge PlainCodec and XChaCha20Poly1305 into EncryptionCodec so we can do the same for it. We'd have a serializable struct that has an Option<CompressionType> and EncryptionType. Additionally, this would include a ClientId or something similar that can be used to determine if replaying is necessary along with the SeqCnt to indicate how far along it is.

The server would send the options, and the client would respond with its selection.

The server would have a new, required (?) method:

async fn on_handshake(&self, transport: FramedTransport<T, ()>) -> io::Result<FramedTransport<T, Box<dyn Codec>>> {
    // NOTE: Need a way to map the codec of a transport -- should be pretty easy to do since we can consume the transport
    Ok(transport)
}

T is a generic for the underlying transport and () would be our default codec that has no encryption or compression.

@chipsenkbeil chipsenkbeil added enhancement New feature or request breaking Would require breaking changes labels Sep 15, 2022
@chipsenkbeil chipsenkbeil added this to the 0.20 milestone Sep 15, 2022
@chipsenkbeil
Copy link
Owner Author

Now implemented in branch using Connection<T> to facilitate the client/server handshake, ability for client to reconnect, and backup restoration.

Handshake includes establishment of codec, authentication, and backup restoration.

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Would require breaking changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant