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 --key-file opt #13

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

HDegroote
Copy link
Contributor

Adds a --key-file option to the hypertele server and client, so it can use keys generated by secure-key. Also includes a --key-file-password option to pass in the password through the CLI rather than through stdin

The key-pair and private options interact as follows:

  • key-file + private: both client and server need to load the same key-file content, since they need to share the same private and public key (which without key-file happens by using the same seed)
  • key-file server (non-private): client can choose whether to use a key-file or not—it joins the server based on the passed-in public key (-s option)
  • no key-file server (non-private): same as above, client can be whatever

The keys are copied to normal memory, to make the code more straightforward (in contrast to hypercore-sign, where they never leave protected memory). I’m fine with keeping the keys in protected memory if that’s a requirement, but it could be quite complex to make sure they never leak to normal memory in the hyperdht code.

Note: I moved everything into an async main because loading the keys from file happens async, so it could not cleanly use the existing structure. Except for that I tried to make the fewest changes possible.

@HDegroote HDegroote marked this pull request as draft February 26, 2024 23:18
@HDegroote
Copy link
Contributor Author

Converted to draft while we're doing an iteration on secure-key

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.

1 participant