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

Changed Private Key Regex to be more tolerant regarding new lines at end of key file #1344

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

staecthSICKAG
Copy link
Contributor

@staecthSICKAG staecthSICKAG commented Mar 5, 2024

SSH.NET so far threw an unhelpful error message regarding an invalid key file if there was a new line between the key data and the end line. The changed regex now allows zero or one empty line.

This is now allowed

...
dw+2Ggyq5W5hl3PDTMTqn8Pc+cwmPdVe4bkNqxbCHe2omZXpNIgC31wrMBvkyUYv
pY8rMoBXqgm9hC5JsXzn6Z6X1kpGFhDjkNSdzx4jYzw=

-----END RSA PRIVATE KEY----- 

Copy link
Collaborator

@Rob-Hague Rob-Hague left a comment

Choose a reason for hiding this comment

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

Just curious, do you know how the key was generated?

Copy link
Collaborator

@WojciechNagorski WojciechNagorski left a comment

Choose a reason for hiding this comment

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

LGTM

@WojciechNagorski WojciechNagorski merged commit 0876e88 into sshnet:develop Mar 6, 2024
1 check failed
@staecthSICKAG
Copy link
Contributor Author

Just curious, do you know how the key was generated?

Not really it was a key handed down to me from another department.
I would not discard the possibility that someone meddled with it to make it more aesthetically pleasing.

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