Skip to content
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

node-sshpk#27 PuTTY private key support #76

Merged
merged 6 commits into from
Jan 6, 2022

Conversation

Eugeny
Copy link
Contributor

@Eugeny Eugeny commented May 15, 2021

Adds support for PPKv2 format with DSA, RSA, ECDSA and Ed25519 keys

@Eugeny Eugeny marked this pull request as ready for review May 15, 2021 17:03
lib/formats/putty.js Outdated Show resolved Hide resolved
lib/formats/putty.js Outdated Show resolved Hide resolved
lib/key.js Outdated Show resolved Hide resolved
lib/formats/putty.js Outdated Show resolved Hide resolved
@Eugeny
Copy link
Contributor Author

Eugeny commented May 21, 2021

All done.

@bahamat
Copy link
Member

bahamat commented May 21, 2021

@arekinath If you can, I'd like you to take another look at this before I merge it.

@bahamat bahamat changed the title PuTTY private key support node-sshpk#27 PuTTY private key support May 21, 2021
@bahamat
Copy link
Member

bahamat commented May 21, 2021

Updated PR subject to link with issue #27

Copy link
Member

@bahamat bahamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took so long. All tests pass, so this is looking pretty good.

Just a couple of formatting nits, and then we can merge this.

lines.slice(si, si + privateLines).join(''), 'base64');

if (encryption !== 'none' && formatVersion === 3) {
throw new Error('Encrypted keys arenot supported for PuTTY format version 3');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines should be <80 chars

Use:

			throw new Error('Encrypted keys arenot supported for' +
			' PuTTY format version 3');

if (parts) {
formatVersion = {
'putty-user-key-file-2': 2,
'putty-user-key-file-3': 3,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 30 should not have a , at the end.
Line 31 needs ; at the end.

@Eugeny
Copy link
Contributor Author

Eugeny commented Jan 6, 2022

Hi guys, straight up and honest, no offence, I'll keep working on encrypted PPK v3 support in my fork, but your crazy linting rules make fiddling with formatting just not worth my time, which is already stretched very thin.

Feel free to tweak it if you want.

@bahamat
Copy link
Member

bahamat commented Jan 6, 2022

@Eugeny No worries! I'll fix it up on my side post-merge.

Again, sorry this took so long to go through. I'm definitely interested in the additional work you're doing for encrypted key support. When you have that ready I'll do what I can to fast-track it. And again, I'll deal with listing issues on my side.

@bahamat bahamat merged commit 1da5a87 into TritonDataCenter:master Jan 6, 2022
@Eugeny Eugeny deleted the ppk-support branch September 27, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants