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

feat: npt: use different session keys for each socket pair #895

Merged
merged 11 commits into from
Mar 21, 2024

Conversation

gkc
Copy link
Contributor

@gkc gkc commented Mar 21, 2024

- What I did

- How I did it

  • Daemon and client Currently, both sides create a control socket and authenticate
    • but there is no e2ee on the control socket
    • Change Now have e2ee on the control socket with encrypters / decrypters using the AES key and IV which were exchanged earlier via atProtocol notifications
  • Client Currently, client side calls serverToSocket
    • On new local socket, sends 'connect' message on the control socket
    • Uses same encrypter & decrypter for all connections
    • Change We now generate new AES key and IV for each new connection and send it along with the 'connect' message. It's safe to do so because the control socket is now end-to-end-encrypted using session key which is exchanged via atProtocol notifications
    • Change And then, using the new 'beforeJoining' callback provided by socket_connector's serverToSocket method, we set encrypt/decrypt transformers on the new Connection's Sides before they start exchanging data
  • Daemon Currently, the daemon side listens for 'connect' messages on the control socket and then creates new socket pairs all of which have the same session keys
    • Change And when we receive a connect message from the client, we use the provided AES and IV to create new encrypters / decrypters for the new socketToSocket pair

- How to verify it

  • Tests pass

@gkc gkc changed the title feat: npt: use different session keys for each socket pair (DRAFT) feat: npt: use different session keys for each socket pair Mar 21, 2024
@gkc gkc marked this pull request as ready for review March 21, 2024 15:36
@gkc gkc requested review from XavierChanth and cconstab March 21, 2024 15:36
@gkc gkc merged commit dd72ba0 into trunk Mar 21, 2024
7 checks passed
@gkc gkc deleted the gkc/npt-new-aes-keys-for-each-socket-pair branch March 21, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants