1. Remove the check on authType, it is covered already.
2. Add Keyboard Setup to the existing check on authType.
3. Add a branch for User Auth None so it reaches its handler
in the map loop rather than the new error case.
4. Add else case for an error.
Fixes CID: 637345
- term size test: poll tmux output with retries instead of fixed sleeps,
re-sending the size query each pass in case the shell was not yet ready
- term close test: scope netstat checks to the test port so unrelated
host CLOSE_WAIT/TIME_WAIT sockets don't fail the test
- run_all_sshd_tests.sh: validate --match before starting wolfSSHd
- renewcerts.sh: build the per-user cert from a throwaway config copy so
the tracked renewcerts.cnf is never modified in place
HandleInclude built the wildcard include path with WSNPRINTF without
checking the result, silently truncating over-long paths (flagged by
GCC 12 as -Werror=format-truncation). Merge the duplicate WSNPRINTF
calls and return WS_INVALID_PATH_E when the path does not fit.
Run the DoUserAuthRequestRsa vectors through the X.509 path to pin
that a raw signature with a high leading bit is accepted via the
RFC 6187 branch. keys/ has no RSA certificate, so the test embeds a
self-signed cert made from keys/hansel-key-rsa.pem (valid until
May 2048).
- Parse each field of the key blob in ParseECCPubKey with its own
scoped variables instead of reusing q/qSz for the algorithm name,
curve name, and public key point.
- Validate blob algorithm name against handshake pubKeyId
- Derive curve from negotiated algo, not the key blob
- Check curve name instead of skipping it
- Add a ParseECCPubKey test checking the key blob algorithm and
curve names are validated against the negotiated host key
algorithm.
Issue: #1012
- GetMpint now rejects values with the sign bit set as
non-canonical (RFC 4251 Section 5) and is rewritten in
terms of GetStringRef.
- Parse RSA signature blobs with GetStringRef; they are
strings of raw signature bytes (RFC 4253 Section 6.6),
not mpints, and often have the high bit set.
- Add unit test covering GetMpint parsing and rejection.
- Add a DoUserAuthRequestRsa test pinning the string parse of
the signature blob with a fixed signature whose leading byte
has the high bit set; an mpint parse would reject it as
negative.
Issue: #1013
OCSP_NEED_URL meant the cert has no AIA OCSP URL and no
default responder is set, so OCSP cannot run. Treat it as
not-revoked instead of failing the whole verification.
This softens revocation from hard-fail to soft-fail for that case
only. The AIA URL is part of the signed certificate and is not
attacker-strippable, so a malicious peer cannot use this to bypass
an otherwise-enforced OCSP check.
- Add CertManIntermediateIsCA: require isCA and, for non-self-signed
intermediates that carry a KeyUsage extension, the keyCertSign bit
before promoting a cert.
- Only promote a verified intermediate into the trust store when it is
actually a CA; otherwise fail with WS_CERT_NO_SIGNER_E.
- Prevents a peer-supplied end-entity cert at an intermediate position
from being trusted to issue certs for arbitrary SSH principals.
- Gate keyCertSign on ALLOW_INVALID_CERTSIGN and on the KeyUsage
extension being present, matching wolfSSL's AddCA loader.
- Add regression tests: non-CA intermediate is not promoted, and a
valid CA intermediate (with and without KeyUsage) still is.
Issue: F-5851
Cleanup clang-tidy misc-no-recursion finding.
- wolfSSHD_ConfigLoad: track depth on WOLFSSHD_CONFIG
and reject loads past WOLFSSHD_MAX_INCLUDE_DEPTH (16).
- HandleInclude, HandleConfigOption, ParseConfigLine,
wolfSSHD_ConfigLoad: annotate the call cycle with
NOLINTNEXTLINE pointing at the bound.
- Add a recursive configuration test.
Cleanup clang-tidy bugprone-inc-dec-in-conditions finding.
- ParseTimestamp: move ++idx out of the || conditions
and tighten the bound from > bufSz to >= bufSz.
Cleanup clang-tidy concurrency-mt-unsafe finding. Note, this
originally used gmtime which provided UTC based time values. Now,
the wolfSFTP server will provide localtimes for file timestamps.
The exception is Zephyr, which only provides UTC times.
- SFTP_CreateLongName: switch from XGMTIME (gmtime) to
WLOCALTIME, which expands to localtime_r/localtime_s
per platform.
- Note in the Zephyr WLOCALTIME macro that gmtime_r is used
because Zephyr's minimal libc does not provide localtime_r.
- Moved the posix attributes breakdown into a helper function.
- Changed some of the X-prefixed macros to the W-prefixed versions.
- Changed the SFTP longname creation to add a "?" in place of the
number of links. (OpenSSH does the same.)
Cleanup clang-tidy bugprone-signal-handler findings.
- wolfsshd: drop fprintf from interruptCatch; the main accept
loop logs "Closing down wolfSSHD" after seeing quit set.
- sftpclient: annotate wolfSSH_SFTP_Interrupt call in
sig_handler with NOLINT, since the function is only a single
byte store and is safe to call from a signal handler.
- Guard the retry against a negative cnt_w so a non-sentinel
send error cannot become a negative memmove offset.
- Clear windowFullExt at the stdout and childFd save sites so
stream ownership is set unconditionally.
ChannelIdSend / extended_data_send returning WS_WANT_WRITE set
wantWrite but didn't save cnt_r, so the next read overwrote the
held bytes. Store cnt_r in windowFull at all three read sites
(stderr, stdout, pty childFd); flag windowFullExt for stderr so
the retry routes through extended_data_send.
Stderr and stdout shared shellBuffer/windowFull, so a stderr hold
retried on stdout, and a stderr partial send let the stdout read
clobber the remainder. Tag the held bytes with windowFullExt;
retry via extended_data_send and skip the stdout read when set.
SIGCHLD from the exec child interrupts select(), returning -1 and
breaking the loop. Any windowFull data awaiting a peer window adjust
was then abandoned, causing intermittent 32 KB truncations on large
exec transfers. Continue on EINTR.
1. Loop WPWRITE until the full chunk is written, advancing the
split 64-bit offset with carry. Bail out on error or a zero
return and report WOLFSSH_FTP_FAILURE so clients see the
truncation instead of a silent success.
2. Update the backup WPWRITE() implemented with fwrite() to
parallel the behavior of the backup WPREAD(). Changed to write
sz number of 1 byte objects.
Issue: F-3880
Per RFC 8308 Section 2.1.
1. The server will now advertize that it accepts an ext-info message.
2. The client and server will send the ext-info message if requested and
and allowed. The per-side send functions are guarded based on
configuration. The wolfSSH client currently doesn't have anything to
say in an ext-info message.
Issue: F-3448