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 keypair support for ed25519 #13219

Merged
merged 7 commits into from
Jun 27, 2023
Merged

Conversation

chrisroberts
Copy link
Member

@chrisroberts chrisroberts commented Jun 26, 2023

Add support for ed25519 type keys. This support consists of two
parts:

Vagrant insecure private keys

A new ed25519 type public/private key pair has been added to the
./keys directory of the vagrant repository. The public/private
key files in the directory are now the following:

  • ./keys/vagrant - Insecure private key (RSA) - not modified
  • ./keys/vagrant.pub - Insecure public keys (both RSA and Ed25519) - Ed25519 public key appended
  • ./keys/vagrant.key.ed25519 - Insecure private key (Ed25519)
  • ./keys/vagrant.pub.ed25519 - Insecure public key (Ed25519)
  • ./keys/vagrant.key.rsa - Insecure private key (RSA)
  • ./keys/vagrant.key.pub - Insecure public key (RSA)

Vagrant support for ed25519

The Vagrant::Util::Keypair can now generate an RSA or Ed25519
key pair. Both keys are now used for authentication when no private
key has been specified (for example: initial authentication).

When removing the insecure key and replacing it with the a newly
generated key, a check is done to determine what key types Vagrant
supports are supported by the server. The best match will be used.
If a match cannot be determined, Vagrant will fallback to the
previous behavior of generating an RSA keypair.

Fixes #12589
Fixes #12458
Fixes #12693

Add a new ed25519 insecure private key. Update the README with
information about the two insecure keys. Retain the RSA key in the
`vagrant` file and duplicate it into `vagrant.key.rsa`. Append the
ed25519 public key to the `vagrant.pub` file.
Introduce keypair support for ed25519. Default keypair type when
generating without specifying type is rsa to maintain existing behavior.
Check the key types supported by the server. If the data is not
available, default to the previous behavior which is using the rsa key
type.

Update insecure key check to match against any key files located within
the keys directory. For now, this effectively allows matching either rsa
or ed25519 insecure private keys.
Within the environment, add a new directory value which points to the
directory containing the valid insecure private keys. A new default
private key paths value contains an array of all the insecure private
keys which are available for initial authentication.
When constructing the ssh information, use all available insecure key
paths for authentication.
Updates existing test coverage to use insecure private key collection
and adds testing for behavior changes within the communicator and the
keypair utility.
@chrisroberts chrisroberts merged commit 827140c into hashicorp:main Jun 27, 2023
@chrisroberts chrisroberts deleted the ssh-keys branch June 27, 2023 17:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant