server: use ed25519 instead of rsa when generate public/private keys (#8549)

RSA has been considered as insecure and 'ssh-rsa' signature algorithm has been deprecated in OpenSSH.
This commit is contained in:
Wei Zhou 2024-02-05 09:40:05 +01:00 committed by GitHub
parent 3f33592b67
commit 1d5230b516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -619,7 +619,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
// FIXME: take a global database lock here for safety.
boolean onWindows = isOnWindows();
if(!onWindows) {
Script.runSimpleBashScript("if [ -f " + privkeyfile + " ]; then rm -f " + privkeyfile + "; fi; ssh-keygen -t rsa -m PEM -N '' -f " + privkeyfile + " -q 2>/dev/null || ssh-keygen -t rsa -N '' -f " + privkeyfile + " -q");
Script.runSimpleBashScript("if [ -f " + privkeyfile + " ]; then rm -f " + privkeyfile + "; fi; ssh-keygen -t ed25519 -m PEM -N '' -f " + privkeyfile + " -q 2>/dev/null || ssh-keygen -t ed25519 -N '' -f " + privkeyfile + " -q");
}
final String privateKey;