Skip to content

wolfssh: warn when a known host adds a key type - #1345

Open
ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:known-host-key-type
Open

ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:known-host-key-type

Conversation

@ejohnstown

@ejohnstown ejohnstown commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The wolfssh client reported a host pinned in known_hosts with one key
type that presented another as an unknown host. It now says the host is
known with a different key type, naming the pinned entry, before asking.

  • A later entry of the presented type still matches, or rejects a
    different key, as before.
  • A server key type that is not printable ASCII is refused before it is
    printed or stored.

Issue: ZD-22634

The known_hosts search skips an entry whose host matches but whose key
type differs, so a host pinned with one type that presents another was
reported as an unknown host. The check now remembers that the host is
known with another type and says so before offering to add the new one,
as OpenSSH does.

- note the first other-type entry's key type and line in the loop
- print a warning with that entry, the host and the new fingerprint
  before the add prompt; a later same-type entry still matches or
  rejects as before
- reject a server key type that is not printable ASCII before it is
  printed or stored
- regress.c: add TestKnownHostsOtherType

Issue: ZD-22634
Copilot AI balanced review requested due to automatic review settings October 28, 2026 20:06

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@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 #1345

Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

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