mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ssh: Add support for ecdsa and ed25519 public keys (#3740)
See #3705 Fixes: #3705 Signed-off-by: Kai Takahashi <k-takahashi@creationline.com>
This commit is contained in:
parent
828405d297
commit
e56fa31379
@ -88,7 +88,13 @@ public class SSHKeysHelper {
|
||||
if (!keyMaterial.contains(" "))
|
||||
keyMaterial = new String(Base64.decodeBase64(keyMaterial.getBytes()));
|
||||
|
||||
if ((!keyMaterial.startsWith("ssh-rsa") && !keyMaterial.startsWith("ssh-dss")) || !keyMaterial.contains(" "))
|
||||
if ((!keyMaterial.startsWith("ssh-rsa")
|
||||
&& !keyMaterial.startsWith("ssh-dss")
|
||||
&& !keyMaterial.startsWith("ecdsa-sha2-nistp256")
|
||||
&& !keyMaterial.startsWith("ecdsa-sha2-nistp384")
|
||||
&& !keyMaterial.startsWith("ecdsa-sha2-nistp521")
|
||||
&& !keyMaterial.startsWith("ssh-ed25519"))
|
||||
|| !keyMaterial.contains(" "))
|
||||
return null;
|
||||
|
||||
String[] key = keyMaterial.split(" ");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user