The client, scpclient and sftpclient accept a plain host key only when
a "host type key" line of ~/.ssh/known_hosts holds it. An unknown or
changed key is refused, printing its fingerprint and the line to add.
-Y accepts any key, with a warning.
- Check that an x509v3 host certificate names the host by DNS or IP
subjectAltName, or by common name without one; -X waives a mismatch
- Pass -Y in the tests and CI jobs that connect to a throwaway server
- Seed known_hosts for openssh-interop.test from sshd's host keys
- Add client-hostkey.test for unknown, known, stale and changed keys
Issue: F-7620
ParseScpCommand stops looking for options once -t or -f has taken the
rest of the command as the path, and skips a "--" before it. A target
with no directory part names a file in the current directory, unless
it names an existing directory, which stays the target as in OpenSSH.
- ScpCheckForRename keeps a bare name whole and uses "." as its base,
and leaves ".", "..", and an existing directory as they are
- GetScpFileMode checks the start index and the full mode field before
reading
- DoScpRequest returns WS_SUCCESS when data follows a finished transfer
- tests: add ParseScpCommand cases, with directory targets and path
checks skipped on Windows, and GetScpFileMode index cases
- scp.test: copy to and from "." in both directions
Issue: F-15504, F-15501, F-11655, F-13320
The default SCP receive callback keeps its destination per session, the
base path plus each directory entered, in place of the process working
directory that every session of a threaded server shares. With openat()
it holds that directory open, reaches it and everything created below
it with O_NOFOLLOW, and confirms a reopened parent is the one entered.
- port.h gains WOPENAT, WMKDIRAT, WOLFSSH_O_SEARCH with a search check
as chdir() made, and WOLFSSH_HAVE_DIRFD, which sizes WOLFSSH so it
keys only on configure's openat() probe; WOLFSSH_NO_DIRFD opts out
- ports without them open by the full path after a wIsDirNoFollow()
screen of the base and of each directory entered; a refused base
frees the receive path
- the receive path is capped at DEFAULT_SCP_FILE_NAME_SZ like the
send side's; futimes() stands in for futimens() on hosts with
openat() but not futimens(), such as macOS before 10.13
- unit: ScpRecvCallback_SessionPath walks down and back with the
working directory untouched, then has the tree moved out from under
it; a linked base and a file-named directory are refused
- scp.test: a planted symlink at the destination name keeps its target;
scp-test.yml also builds and tests the fallback
Issue: F-14758, F-13998
The sftp, scp and get-put scripts wait for the echoserver to publish its
port before connecting. Two seconds is not enough for a libtool re-exec,
the dynamic linker and the sample-key parse with a dozen sibling test
jobs on the machine, so a parallel make check failed them at their first
scenario. Ten seconds matches what sshclient.test already allows.
- raise the three wait loops from 20 to 100 iterations of 0.1 seconds
- test -s, not -e, after the loop in scp.test and get-put.test: the
ready file is created empty and the port written afterward, so -e can
take a file caught mid-write and yield an empty port
The -A cases in scp.test reach the exec callback and the scp handoff.
These drive the rest: the subsystem callback with the sftp accept, the
shell callback in echo mode, and both accepts on a blocking server.
- sftp.test connects to an -A server blocking and non-blocking
- sshclient.test runs a terminal session and a command session against
an -A server
- scp.test copies from a blocking -A server, where wolfSSH_SCP_accept()
completes in one call rather than through the retry loop
The echoserver's -A mode runs an accepted scp command through
wolfSSH_SCP_accept(). Reaching that call's want retry path takes a
non-blocking server, which -N supplies.
- copy to and from an app-driven server in scp.test
- check the entry point's null-session argument
The scripts now read the build options from the probe instead of grepping
usage text, config.log and daemon logs. Drops the usage lines only tests read.
Simulate netowrk latency using netem and use it to test the non-blocking
mode of SFTP. This helps find issues which would affect running an SFTP
server on a microcontroller. It helped find the bug fixed in #876.
1. Update scp.test to delete the empty test file.
2. In wolfSSHd, when coverting an IP address to a printable
representation, the destination needs to be able to handle IPv6
addresses potentially.