Repository navigation
wolfssh: decide known hosts the way OpenSSH asks - #1385
ejohnstown wants to merge 1 commit into
Conversation
|
@claude review |
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. It changes how the client decides whether to trust a server's host key, so a human look would still be worthwhile.
What was reviewed:
- The
load_text_fileresult handling: a missing or empty known_hosts prompts, and an unreadable one refuses. An unset HOME now sets ret = -1. - The
encSzsizing(pubKeySz+2)/3*4+1, including theMAX_PACKET_SZbound and the type/fingerprint offsets; the scan now breaks on a match, and the client rejects only onbadMatch && !found. - The cert IP check now runs only when ret == 0, so the IP override can no longer clear an earlier rejection.
MakeParentDircreates only the last directory, with mode 0700, and the open is retried.
Extended reasoning...
The change rewrites the host key verification path in apps/wolfssh/common.c. It covers known_hosts parsing, the trust-on-first-use prompt, how a stale or mismatched entry is resolved, and the certificate IP override. It also creates ~/.ssh when it is missing. Host key verification is an authentication decision, so mistakes here can enable MITM acceptance. That alone puts it above the bar for auto-approval. The new shell and regress tests cover the ask, EOF, stale-entry and ML-DSA-87 cases, but no tests were run in this review.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1385
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): scripts/sshclient.test
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: Max
ClientPublicKeyCheck() follows StrictHostKeyChecking=ask. A missing or empty known_hosts has no entries and prompts, creating ~/.ssh with mode 0700 on yes; one it cannot read refuses, as does EOF at the prompt. A line holding the key accepts wherever it is in the file. - Size the base64 host key buffer from the blob, so ML-DSA keys fit - Keep scanning past a stale same-type line for the host - Check the certificate IP only once known_hosts accepts, and let the override waive only the IP mismatch - Cover these in regress.test and sshclient.test Issue: F-14635, F-15505, F-15508, F-15664
395c518 to
8f71d11
Compare
The wolfssh client follows StrictHostKeyChecking=ask: a missing or empty
known_hosts prompts, an unreadable one or EOF at the prompt refuses, and
a matching line accepts wherever it is in the file.
Issue: F-14635, F-15505, F-15508, F-15664