Skip to content

Fix minor issues and add regress test#972

Merged
ejohnstown merged 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:minorIssues
May 12, 2026
Merged

Fix minor issues and add regress test#972
ejohnstown merged 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:minorIssues

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

This PR fixes the following issues:

  • Fix ParseConfigLine to use correct idx
  • Harden GetOpenSshKey to return error for wrong padded key
  • Fix return code clobbers in src/keygen.c

Also, this adds a unit test for wrong padded OpenSSH key scenario.

@yosuke-wolfssl yosuke-wolfssl self-assigned this May 12, 2026
Copilot AI review requested due to automatic review settings May 12, 2026 06:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ParseConfigLine by 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.

Comment thread src/keygen.c Outdated
Comment thread src/keygen.c Outdated
Comment thread src/keygen.c Outdated
Comment thread src/internal.c
Comment thread tests/api.c
@ejohnstown ejohnstown merged commit 7d7d04d into wolfSSL:master May 12, 2026
131 checks passed
@yosuke-wolfssl yosuke-wolfssl deleted the minorIssues branch May 12, 2026 22:26
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.

4 participants