InitSshd: Generate ecdsa and ed25519 keys if the host supports them
Change-Id: Iad0fdea4f2acb97207d553ed30fdfbf9b0d83067
This commit is contained in:
committed by
David Pursehouse
parent
6a7bf29e8d
commit
c3319bf15e
@@ -41,14 +41,22 @@ class HostKeyProvider implements Provider<KeyPairProvider> {
|
||||
Path objKey = site.ssh_key;
|
||||
Path rsaKey = site.ssh_rsa;
|
||||
Path dsaKey = site.ssh_dsa;
|
||||
Path ecdsaKey = site.ssh_ecdsa;
|
||||
Path ed25519Key = site.ssh_ed25519;
|
||||
|
||||
final List<File> stdKeys = new ArrayList<>(2);
|
||||
final List<File> stdKeys = new ArrayList<>(4);
|
||||
if (Files.exists(rsaKey)) {
|
||||
stdKeys.add(rsaKey.toAbsolutePath().toFile());
|
||||
}
|
||||
if (Files.exists(dsaKey)) {
|
||||
stdKeys.add(dsaKey.toAbsolutePath().toFile());
|
||||
}
|
||||
if (Files.exists(ecdsaKey)) {
|
||||
stdKeys.add(ecdsaKey.toAbsolutePath().toFile());
|
||||
}
|
||||
if (Files.exists(ed25519Key)) {
|
||||
stdKeys.add(ed25519Key.toAbsolutePath().toFile());
|
||||
}
|
||||
|
||||
if (Files.exists(objKey)) {
|
||||
if (stdKeys.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user