Fix minor issues and add regress test#972
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR addresses a few correctness issues in config parsing and key handling, and adds a regression test to ensure malformed OpenSSH padding is rejected.
Changes:
- Fix whitespace-counting bounds in
ParseConfigLineby using the correct remaining-length calculation. - Harden OpenSSH private key parsing to fail on invalid padding.
- Prevent keygen cleanup failures from overwriting earlier return codes, and add a unit test for the bad-padding case.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/api.c | Adds a malformed OpenSSH ECDSA key fixture and a regression test asserting it is rejected. |
| src/keygen.c | Avoids overwriting earlier errors with cleanup errors during RSA/ECDSA/Ed25519 key generation. |
| src/internal.c | Marks invalid OpenSSH padding as a key-format error during parsing. |
| apps/wolfsshd/configuration.c | Fixes an index/length bug when scanning whitespace for config values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ebdf5c8 to
47a07d4
Compare
ejohnstown
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the following issues:
Also, this adds a unit test for wrong padded OpenSSH key scenario.