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

Improve malformed file handling for OpenSSH Private Keys #898

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

exceptionfactory
Copy link
Contributor

This pull request improves malformed file handling for OpenSSH Private Keys, resolving a potential NullPointerException described in issue #897.

The improvement adds standard null checking while reading lines from the input BufferedReader, and also throws an IOException with a message indicating the absence of the required END OPENSSH PRIVATE KEY footer.

Changes also include new test cases for invalid header and footer lines.

@codecov-commenter
Copy link

Codecov Report

Merging #898 (6308633) into master (f4d34d8) will increase coverage by 0.02%.
The diff coverage is 90.90%.

@@             Coverage Diff              @@
##             master     #898      +/-   ##
============================================
+ Coverage     68.36%   68.39%   +0.02%     
- Complexity     1397     1399       +2     
============================================
  Files           207      207              
  Lines          7423     7430       +7     
  Branches        629      631       +2     
============================================
+ Hits           5075     5082       +7     
  Misses         2014     2014              
  Partials        334      334              
Files Coverage Δ
...sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java 85.35% <90.90%> (+0.68%) ⬆️

@hierynomus hierynomus merged commit 461c0e4 into hierynomus:master Oct 9, 2023
6 checks passed
@hierynomus
Copy link
Owner

Thanks @exceptionfactory !

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.

None yet

3 participants