-
Notifications
You must be signed in to change notification settings - Fork 66
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
Remove usage of obsolete trilead-putty key #200
Remove usage of obsolete trilead-putty key #200
Conversation
…-api which was really used Signed-off-by: Olivier Lamy <[email protected]>
I have no idea how often putty style keys are used (mostly generated from windows users I guess), but if we need to the spec is public. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up #199 I guess.
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Olivier Lamy <[email protected]>
Signed-off-by: Olivier Lamy <[email protected]>
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
…l/BasicSSHUserPrivateKey.java Co-authored-by: Jesse Glick <[email protected]>
…nternal usage only Signed-off-by: Olivier Lamy <[email protected]>
String key = reader.toOpenSSH(privateKey, passphrase); | ||
if(key != null) { | ||
privateKeys.add(key); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to break out of the outer loop (meaning adding a label) rather than the inner loop. Otherwise for a PuTTY key you will add two entries to privateKeys
.
(Is there no test coverage for this?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well I'm really tempted to remove this putty key extension as this is not up to date and doesn't even work with current version of PuTTy.
using something such puttygen -t rsa -b 2048 -o mykey.ppk uttygen -t rsa -b 2048 -o mykey.ppk
you get a file starting with
PuTTY-User-Key-File-3: ssh-rsa
This key will simply generate a NPE because of this line https://github.com/kohsuke/trilead-putty-extension/blob/e928d8b5cc80a35d521b05e8256bdd5100cba616/src/main/java/org/kohsuke/putty/PuTTYKey.java#L149
So I'm just tempted to remove this code which simply doesn't work anymore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR v3 was released with 0.75 which was 2021-05-08
so it almost 3 years ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, in the last 3 years, no single key created with PuTTy could have been used.
I couldn't find any issue reported in Jira...
It looks like we can remove the support of the PuTTy key format.
I'm not sure why someone re-invented the wheel by inventing another format.
Signed-off-by: Olivier Lamy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to remove, but I'm sure someone will be using an old V2 key from a server configured long ago...
Not sure why putty keys were not using a different Key source to begin with though
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Olivier Lamy <[email protected]>
Easy bet to win :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, but will delay merging to let others have an opinion
I can announce that you won your bet :) Here is, for those who will encounter this problem, how to convert your older PuTTY credentials to more standard ones:
The resulting file can be used as the private key in a new credentials entry, with the same passphrase. |
@salsifis I took the liberty of adding your instructions (unconfirmed) to https://github.com/jenkinsci/ssh-credentials-plugin/releases/tag/334.v7732563deee1 for better discoverability. @olamy / @jtnord should this be reverted and the originally proposed extension point reintroduced? |
I am in 2 minds here. |
@salsifis congratulations! bravo :) |
In my opinion the main problem here is that this end of support was not announced (no warnings or whatever in the Jenkins interface). We had to look at the Jenkins logs and do some research to understand why an update caused the jobs to abort. It would be better to have warnings if deprecations are on the table. |
@olamy can you add the |
That sounds like a good idea. #202 |
Signed-off-by: Olivier Lamy [email protected]
Testing done
Submitter checklist