Skip to content

Commit

Permalink
Merge pull request #595 from amedee/ssh-key-check-too-strict
Browse files Browse the repository at this point in the history
SSH key check is too strict
  • Loading branch information
res0nance authored Apr 13, 2021
2 parents 366e80d + c64692f commit a674aee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/hudson/plugins/ec2/EC2Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -1102,9 +1102,11 @@ public FormValidation doCheckSshKeysCredentialsId(@QueryParameter String value)
BufferedReader br = new BufferedReader(new StringReader(privateKey));
String line;
while ((line = br.readLine()) != null) {
if (line.equals("-----BEGIN RSA PRIVATE KEY-----"))
if (line.equals("-----BEGIN RSA PRIVATE KEY-----") ||
line.equals("-----BEGIN OPENSSH PRIVATE KEY-----"))
hasStart = true;
if (line.equals("-----END RSA PRIVATE KEY-----"))
if (line.equals("-----END RSA PRIVATE KEY-----") ||
line.equals("-----END OPENSSH PRIVATE KEY-----"))
hasEnd = true;
}
if (!hasStart)
Expand Down

0 comments on commit a674aee

Please sign in to comment.