mirror of https://github.com/wolfSSL/wolfssh.git
CI's mingw-regress job showed AppendKeyToFile writing a known_hosts entry, then TestAppendKeyToFile reading it back and finding a byte mismatch on Windows. The file was opened with WFOPEN(..., "a"), a text mode append. On Windows the C runtime rewrites '\n' to CRLF on write in text mode, so the entry landed on disk with a trailing "\r\n" instead of the "\n" the test wrote and expected back. Open the file in binary mode instead, matching the WriteTextFile test helper a few hundred lines above in tests/regress.c, which already uses "wb" for the same reason. known_hosts is conventionally LF-terminated regardless of platform, so this also matches the format other SSH clients expect from the file, not just the test. |
||
|---|---|---|
| .. | ||
| wolfssh | ||
| wolfsshd | ||
| include.am | ||
| wolfssh-options.c | ||