Skip to content

fix newline characters in comment - #1550

Merged
Rob-Hague merged 1 commit into
sshnet:developfrom
Varorbc:develop
Dec 4, 2024
Merged

fix newline characters in comment#1550
Rob-Hague merged 1 commit into
sshnet:developfrom
Varorbc:develop

Conversation

@Varorbc

Copy link
Copy Markdown
Contributor

No description provided.

@Rob-Hague

Copy link
Copy Markdown
Collaborator

Thanks! are you able to modify one of the .ppk files in test/Data in order to demonstrate the problem and fix?

@Varorbc

Copy link
Copy Markdown
ContributorAuthor

The current test case has this problem because it is a ppk file obtained from an embedded resource, so it works fine. This problem occurs if you read directly from disk. So how do I add test cases? I hope you can give me some advice.

@scott-xu

Copy link
Copy Markdown
Collaborator

@Varorbc Just out of curiosity, what's the binary difference between embedded resource and loose file?

@Varorbc

Copy link
Copy Markdown
ContributorAuthor

@scott-xu Sorry about that, I got the issue mixed up earlier. Let me correct it: The PPK files in the current test cases use \n for new lines, but the PPK files generated by the older PuTTYgen client use \r\n.

@VarorbcVarorbc changed the title Update PuTTYPrivateKeyPatternfix newline characters in commentDec 4, 2024
@Rob-Hague

Copy link
Copy Markdown
Collaborator

right, because the comment is included in the MAC, so we don't want to greedily match the \r. Thanks!

FYI: the changed .ppk file still has LF line endings because we normalize these files:

test/Data/*eol=lf

but the problem is understood well enough

@Rob-Hague
Rob-Hague merged commit ee054f4 into sshnet:developDec 4, 2024
This was referenced Aug 12, 2026
Sign up for freeto 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

@Varorbc@Rob-Hague@scott-xu