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

change ssh private key default to ed25519 before checking for rsa #384

Open
jashandeep-sohi opened this issue Jul 26, 2021 · 3 comments
Open

Comments

@jashandeep-sohi
Copy link
Contributor

jashandeep-sohi commented Jul 26, 2021

Currently, only RSA keys are supported:

let private_key = identity.unwrap_or(home()?.join(".ssh/id_rsa"));

However, more and more people are defaulting to ed25519(myself included). Having to setup a rsa key just for cargo-generate is not ideal.

cargo-generate should at least support ed25519 keys as well.

Edit: I realize I could manually override this via -i | --identity, but my request is to make it automatically use id_ed25519 if it exists.

@jashandeep-sohi jashandeep-sohi changed the title Support SSH keys other than RSA Support ed25519 SSH keys by default Jul 26, 2021
@sassman
Copy link
Member

sassman commented Jul 26, 2021

My proposal would be to try a couple of defaults and what ever is there will be used. With this given order:

  • RSA id_rsa
  • ed25519

Anything else that folks are using that is not mentioned in the list above?

@jashandeep-sohi
Copy link
Contributor Author

This also got me thinking about something else. What happens when keys are password protected (or more recently require a security key to unlock). Wouldn't it just be better to delegate all of this to ssh-agent via https://docs.rs/git2/0.7.5/git2/struct.Cred.html#method.ssh_key_from_agent or any credential helper via https://docs.rs/git2/0.7.5/git2/struct.Cred.html#method.credential_helper

@sassman
Copy link
Member

sassman commented Jul 26, 2021

those are very valid points. I'll toy around with them in order to understand the behaviour in cases there no ssh-agent is running or the credential helper fails to figure things out.

But I guess we can extend the scope of this issue to support also arbitrary protected private keys, not only elliptic curve keys.

@sassman sassman changed the title Support ed25519 SSH keys by default Support ed25519 as well as arbitrary protected private SSH keys Jul 27, 2021
@sassman sassman changed the title Support ed25519 as well as arbitrary protected private SSH keys Support ed25519 and arbitrary protected private SSH keys Jul 27, 2021
@sassman sassman changed the title Support ed25519 and arbitrary protected private SSH keys change ssh private key default to ed25519 before checking for rsa Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants