Skip to content

F-8824: enable config files without trailing newline - #1156

Merged
ejohnstown merged 2 commits into
wolfSSL:masterfrom
padelsbach:config-file-no-newline
Aug 19, 2026
Merged

ejohnstown merged 2 commits into
wolfSSL:masterfrom
padelsbach:config-file-no-newline

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables known_hosts parsing to handle files whose last line does not end with a trailing newline, and adds regression coverage to prevent reintroducing the issue.

Changes:

  • Make load_der_file() allocate an extra byte and NUL-terminate the buffer past the file contents.
  • Update ClientPublicKeyCheck() parsing to avoid clobbering the last byte and to normalize CRLF line endings.
  • Add a regression test that exercises last-entry matching with \n, no trailing newline, and \r\n.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/wolfssh/common.c NUL-terminate loaded file buffers and normalize CRLF in known_hosts parsing.
tests/regress.c Add regression test for known_hosts last-line handling (with/without trailing newline and CRLF).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/wolfssh/common.c Outdated
Comment thread tests/regress.c Outdated

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1156

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 5
5 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread tests/regress.c
Comment thread tests/regress.c Outdated
Comment thread tests/regress.c
@padelsbach
padelsbach force-pushed the config-file-no-newline branch from 601d645 to bf2d332 Compare August 13, 2026 16:38
Comment thread tests/regress.c
Comment thread tests/regress.c Outdated
Comment thread tests/regress.c

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1156

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 5
5 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread tests/regress.c Outdated
Comment thread apps/wolfssh/common.c Outdated
Comment thread tests/regress.c Outdated
Comment thread tests/regress.c Outdated
Comment thread tests/regress.c
@padelsbach
padelsbach force-pushed the config-file-no-newline branch from bf2d332 to 87aa830 Compare August 17, 2026 21:18
@ejohnstown
ejohnstown merged commit b92e57a into wolfSSL:master Aug 19, 2026
169 of 170 checks passed
@ejohnstown

Copy link
Copy Markdown
Contributor

The issue described by F-8824 was already fixed upstream. This fixes the write side of the known_hosts file, and adds testing.

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