Commit Graph

450 Commits (10d97e151fbab0c8d06be441cdc8c2e121bca65d)

Author SHA1 Message Date
aidan garske 4a50777e04 F-4108 - Build full path and check lstat return in QNX Include scan 2026-07-20 17:24:02 -05:00
aidan garske f9fc298637 F-4105 - Write only bytes read to Windows stdout handle 2026-07-20 17:24:02 -05:00
aidan garske 404b5130cf F-3210 - Null-check command allocation in client argument parsing 2026-07-20 17:24:02 -05:00
aidan garske aa7b268376 F-4795 - Guard ClientPublicKeyCheck against short public key blob 2026-07-20 17:24:02 -05:00
Emma Stensland 1f674b0ec7 SSHD/Echoserver: Fix memory leaks and public-key lookup 2026-07-17 20:01:44 -05:00
John Safranek 2f8d15f40a Use wolfCrypt's wc_ForceZero()
- Keep a gated fallback, wolfSSH_ForceZero().
- Add macro WS_FORCEZERO gated between wc_ForceZero() or
  wolfSSH_ForceZero().
- Use WS_FORCEZERO() in place of the local ForceZero().
- Change the fallback's length parameter from word32 to size_t to
  match wc_ForceZero()'s signature.
2026-07-17 15:17:36 -06:00
Yosuke Shimizu 62639efd35 Enforce LoginGraceTime in wolfsshd on Windows and make the grace flag per-connection 2026-07-07 12:43:08 -05:00
Emma Stensland c56dc1027f added ml-dsa plain key and cert algorithms 2026-07-06 16:51:21 -05:00
Yosuke Shimizu 8ec9aa737c wolfssh/client: reject unsanitized fields before known_hosts write 2026-06-26 14:30:31 -07:00
Yosuke Shimizu 323ec15bb0 wolfsshd: add StrictModes and secure loading of trust anchors 2026-06-26 14:13:02 -07:00
Yosuke Shimizu 6bdddc6053 wolfsshd: mark AuthorizedKeysFile as explicitly set in public setter 2026-06-25 13:35:27 -07:00
Yosuke Shimizu 281e4bc19f Treat combined Match User/Group blocks as a conjunction in wolfsshd 2026-06-23 14:57:09 -07:00
Yosuke Shimizu 8ac056793f Update the skip guard for Mac environment 2026-06-18 14:42:52 -07:00
Yosuke Shimizu 1d2b95f979 wolfsshd: fix Match User/Group directive misparse 2026-06-18 14:24:09 -07:00
Yosuke Shimizu ef56aca663 wolfsshd: fix uninitialized fileNames[] deref in HandleInclude 2026-06-18 13:46:05 -07:00
Yosuke Shimizu 253c157066 wolfsshd: implement PubkeyAuthentication config directive 2026-06-18 13:08:14 -07:00
Yosuke Shimizu 7393aaea9b wolfsshd: reject Match blocks using unimplemented selectors 2026-06-16 15:38:16 -07:00
Yosuke Shimizu eef8281609 wolfsshd: bind certificate auth to user, fail closed without FPKI 2026-06-16 11:50:34 -07:00
John Safranek 36e276529f Fix sshd test flakiness and orphan daemon
- 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
2026-06-15 22:05:50 -07:00
John Safranek 69f7799929 Check Include path truncation in sshd config
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.
2026-06-15 21:48:30 -07:00
John Safranek 1d86a8ed27 Bound sshd Include directive recursion
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.
2026-06-09 17:18:39 -07:00
John Safranek 304955ff94 Move unsafe call out of signal handler
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.
2026-06-09 17:03:02 -07:00
John Safranek 863a52be63 Add parameter names to function declarations
Clean up clang-tidy readability-named-parameter findings
across wolfSSH headers and sources.
2026-06-09 17:03:02 -07:00
Yosuke Shimizu a760b9a1d2 apps/wolfssh: fix ssh://hostname destination without explicit port 2026-06-09 11:11:37 -07:00
Yosuke Shimizu 6af538ded0 Fix 2026-06-09 11:05:54 -07:00
Yosuke Shimizu 3f981d1e8d wolfsshd: fix peer-controlled over-read in Windows pseudo-console resize 2026-06-09 11:05:54 -07:00
Yosuke Shimizu d49b15f51a SFTP path confinement and status-reply refactor 2026-06-09 10:46:17 -07:00
Yosuke Shimizu 2d0ef5aee4 wolfsshd: honor Match-block auth restrictions in DoCheckUser and RequestAuthentication 2026-06-08 14:54:28 -07:00
Yosuke Shimizu d234a2721d Add unit tests for wolfSSHD_AuthReducePermissionsUser 2026-06-04 13:20:29 -07:00
John Safranek fd334579c5 wolfsshd: fix data loss in Windows shell relay
- buffer unsent bytes on backpressure/partial send and resend
- hold loop open until buffered data flushes after child exit
2026-06-03 07:40:27 -07:00
John Safranek 9d62a4483a wolfsshd: set stdoutEmpty on PTY EOF
Lets the relay loop reach its shutdown condition after SIGCHLD
instead of relying on a -1/EIO break.
2026-06-03 07:40:27 -07:00
John Safranek c851de1708 wolfsshd: harden windowFull retry
- 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.
2026-06-03 07:40:27 -07:00
John Safranek 27439881fd wolfsshd: save shellBuffer on WS_WANT_WRITE
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.
2026-06-03 07:40:27 -07:00
John Safranek 339c39bb57 wolfsshd: track stream for windowFull retry
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.
2026-06-03 07:40:27 -07:00
John Safranek 094c686142 wolfsshd: retry select() on EINTR in relay loop
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.
2026-06-03 07:40:27 -07:00
John Safranek 2ca89137a8 wolfsshd: gate debug logging behind -d flag
- Enable wolfSSH/wolfSSL debug logging only when -d is passed
- Disable both logging facilities during cleanup
2026-05-28 08:48:13 -07:00
John Safranek 1aac6d2f5a ClientFreeBuffers: zero secrets before free
- Zero private key and password buffers in both apps/wolfssh
  and examples client.
- Also zero keyboard-interactive response buffers in the
  example client.

Issue: F-249
2026-05-21 11:42:43 -07:00
John Safranek 2dc337d34a ClientPublicKeyCheck: drop dead otherMatch guard
- otherMatch is set to 1 immediately above; guard always true.

Issue: F-3205
2026-05-21 11:42:43 -07:00
John Safranek 541f0ac42a wolfsshd: unit test for CheckAuthKeysLine
- Expose CheckAuthKeysLine under WOLFSSHD_UNIT_TEST so tests can link it.
- Add test_CheckAuthKeysLine covering match, different key, and same-length
  key differing only in the last byte.
- Route the test Log() to stderr instead of an unused local buffer.

Issue: F-4107
2026-05-20 13:03:03 -07:00
John Safranek 5f4032f831 wolfssh: config user handling fix
1. Fix where an already allocated config->user is leaked.
2. Copy the argv user name into a heap buffer.

Issue: F-4102
2026-05-20 13:03:03 -07:00
Paul Adelsbach c3640630b0 Allow empty passwords in sshd when PermitEmptyPasswords is set 2026-05-18 13:55:40 -07:00
Yosuke Shimizu 9d9fa2699d Refactor resource cleanup in windows path 2026-05-18 13:35:07 -07:00
Yosuke Shimizu fb1aa6daba Fix minor issues and Add test vectors 2026-05-14 09:36:43 -07:00
John Safranek 822c09d0eb Fix integer overflow in ParseRFC6187 name length
- Reject name lengths that would overflow m when added
  to sizeof(word32), preventing OOB reads on later checks.

Issue: F-1277
2026-05-12 21:39:33 -07:00
Yosuke Shimizu 7d7d04dc70 Fix minor issues and Add unit test for wrong padded OpenSSH key 2026-05-12 13:14:56 -07:00
John Safranek 2e1ff86799 Reject unknown host when user declines to add key
ClientPublicKeyCheck() prompted to add an unknown server's key
to known_hosts but, if the user declined, left ret at 0 and
returned WS_SUCCESS, silently accepting the unverified host.
Set ret = -1 in the else branch to mirror the otherMatch case
and abort the handshake when the user does not confirm.

Issue: F-3444
2026-05-11 22:28:44 -07:00
John Safranek aef3e8661a fix config_print to show pubKeyFile
Issue: F-214
2026-05-08 12:26:36 -07:00
John Safranek 90d5d44910 wolfsshd: zero stored hash copy before free
Issue: F-57
2026-05-08 12:26:36 -07:00
Yosuke Shimizu dc914afd73 Fix minor issues 2026-05-08 09:59:00 -07:00
Yosuke Shimizu fdf621c83a Add log for LoginGraceTime on windows, Add regress test and fix minor issues 2026-04-23 10:19:13 -07:00
Yosuke Shimizu b557998ddf Add default loginTimer 2026-04-23 10:19:13 -07:00
John Safranek 1b971ffaf4 Fix scan-build warning for undefined errno read after execv
Remove the errno check in the condition after execv(). If execv()
returns at all, it has failed, so checking ret alone is sufficient.
The errno check was flagged by clang scan-build as potentially
reading an undefined value (unix.Errno).
2026-04-22 10:27:06 -07:00
John Safranek bfbf0edbb9 7-bit Clean ASCII
Clean up the main set of files to be 7-bit clean ASCII. There were many
single and double-quotes and n-dashes.
2026-04-22 10:27:06 -07:00
John Safranek 87c0b05d72 Userauth none bypasses wolfSSHd credential check
When wolfsshd is built with WOLFSSH_ALLOW_USERAUTH_NONE, the
DefaultUserAuth() function accepted WOLFSSH_USERAUTH_NONE as a valid
auth type and forwarded it to RequestAuthentication(). Since
RequestAuthentication() only gates credential checks on PASSWORD and
PUBLICKEY types, a none request for any existing system user returned
success without verifying any credential. Removed USERAUTH_NONE as an
accepted auth type in DefaultUserAuth() so it is treated as an invalid
auth type for wolfsshd.

Affected function: DefaultUserAuth.
Issue: F-3215
2026-04-21 09:20:12 -07:00
Paul Adelsbach 80da96eebb Add negative test case for CheckPasswordHashUnix 2026-04-20 09:58:07 -07:00
John Safranek 0049c55b1b
Merge pull request #931 from yosuke-wolfssl/f_2074
Fix wolfSSHD_ConfigCopy and wolfSSHD_ConfigFree
2026-04-17 10:24:29 -07:00
Yosuke Shimizu 2608f90fa1 Fix FingerprintKey 2026-04-17 17:52:30 +09:00
Yosuke Shimizu 97a0c7b5b7 Fix wolfSSHD_ConfigCopy and wolfSSHD_ConfigFree, and Add the regression test 2026-04-17 17:31:40 +09:00
Paul Adelsbach 854a36248e Replace WMEMCMP in CheckAuthKeysLine 2026-04-13 10:19:24 -07:00
Yosuke Shimizu d0aad2be69 Fix f_405 2026-03-27 08:24:23 +09:00
Yosuke Shimizu 087fba94bb Fix f_404 2026-03-27 08:24:23 +09:00
John Safranek 2f1231d185 macOS Semaphore Cleanup
macOS uses GCD for threading and semaphores, but they aren't quite like
POSIX semaphores. macOS allows the use of named POSIX semaphores.

1. Convert the semaphores to named POSIX semaphores.
2. Simplify all calls for semaphores into single function calls of the
   wrapper API.
3. Update both examples/client/client.c and apps/wolfssh/wolfssh.c.
4. Update both to deregister the WINCH signal.
2026-03-17 19:26:32 -07:00
John Safranek 801ac0701d Non-constant-time password hash comparison
In wolfSSHd, the comparisons of the password hash and public keys were
using memcmp(). Changed to use ConstantCompare().

Affected functions: CheckPasswordHashUnix, CheckPublicKeyUnix.
Issue: F-53
2026-03-16 14:20:18 -07:00
John Safranek b048f18d8c
Merge pull request #885 from padelsbach/padelsbach/finding-401-402-403
Fix multibyte passwords, file mode and attrib reporting
2026-03-09 10:27:56 -07:00
JacobBarthelmeh 1e1140aa5a
Merge pull request #883 from ejohnstown/static-fixes
Static analysis fixes
2026-03-06 10:09:29 -07:00
John Safranek 3cfec8b3d2 Missing ForceZero on plaintext password copy
When a copy of the user's password is freed, it wasn't getting force
zeroed. It might still exist in the heap after getting freed.  Added
a call to `ForceZero()`.

Affected function: CheckPasswordUnix.
Issue: F-56
2026-03-05 10:45:37 -08:00
John Safranek 2da09427cd Operator Precedence Bug
Added parens around an assignment to a variable before it is compared to
an expected value.

Affected function: SetupUserTokenWin.
Issue: F-210
2026-03-05 10:43:56 -08:00
Paul Adelsbach 0458d83137 Fix multibyte passwords, file mode and attrib reporting 2026-03-04 15:29:36 -08:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
John Safranek d6e1b04316 Check correct pointer for null
After creating a new SSH context, the pointer returned wasn't checked;
the pointer to the pointer was checked. Changed to the correct pointer.

Affected function: SetupCTX.
2026-02-24 16:43:18 -08:00
John Safranek c802a7faf4 Fix null check for duplicated string
When making a copy of a string, check the destination pointer of the
copy rather than the original.

Affected function: CheckPasswordUnix.
2026-02-24 16:15:11 -08:00
Andrew Hutchings 99319bf773 Fix wrong variable checked in DoCheckUser auth callback
In DoCheckUser, after calling auth->checkUserCb(usr) into rc, the
failure check on line 1063 compared ret instead of rc against
WSSHD_AUTH_FAILURE. Since ret is WOLFSSH_USERAUTH_SUCCESS at that
point, the condition was always false, causing callback failures to
fall through to the generic error branch with WOLFSSH_USERAUTH_FAILURE
instead of returning WOLFSSH_USERAUTH_INVALID_USER.
2026-02-23 10:21:35 +00:00
JacobBarthelmeh 069dcc0949 fix for warning with snprintf use in test case 2026-01-09 10:56:11 -07:00
John Safranek 8951bd9209 Release v1.4.22
1. Update copyright date to 2026.
2025-12-29 16:53:33 -08:00
Daniel Pouzzner 3636446baf
Merge pull request #852 from divinity76/fix-sys-errno
replace sys/errno.h with errno.h
2025-12-15 10:42:26 -06:00
Andrew Hutchings dee1c59f26 Fix double-free crash and socket-close spin 2025-12-09 09:36:38 -08:00
hanshenrik 44dc148dbd replace sys/errno.h with errno.h
Historically, some systems have used <sys/errno.h> in place of <errno.h>, but the C standard,
 all the way back to C89/Ansi C, specifies that the correct name is `errno.h` -
and most modern compilers create a sys/errno.h compatibility shim sys/errno.h -
but musl-gcc does not have this compatibility shim,
 reasoning that sys/errno.h is non-standard, and fails to compile:
```
$ CC=musl-gcc ./configure --enable-static --disable-shared --enable-scp --enable-sftp --enable-shell --with-wolfssl=wolfssl/install-musl
(...)
$ make
make -j17  all-am
make[1]: Entering directory '/home/hans/projects/wolfssh'
  CC       examples/client/common.o
  CC       examples/client/client.o
  CC       src/libwolfssh_la-ssh.lo
  CC       src/libwolfssh_la-internal.lo
  CC       src/libwolfssh_la-log.lo
  CC       src/libwolfssh_la-port.lo
  CC       src/libwolfssh_la-io.lo
  CC       src/libwolfssh_la-wolfscp.lo
  CC       src/libwolfssh_la-wolfsftp.lo
  CC       examples/echoserver/echoserver.o
  CC       src/libwolfssh_la-wolfterm.lo
  CC       examples/sftpclient/sftpclient.o
  CC       examples/scpclient/scpclient.o
In file included from examples/echoserver/echoserver.c:91:
/usr/include/x86_64-linux-musl/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
      |  ^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:1452: examples/echoserver/echoserver.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/hans/projects/wolfssh'
make: *** [Makefile:1020: all] Error 2
```

so, unless we need to support pre-C89 (35+ year old C) compilers,
we can just replace sys/errno.h with errno.h.
2025-11-22 17:40:20 +01:00
JacobBarthelmeh 91c9279c22 simplify wolfSSH_ChannelIsPty to only take a pointer to a channel 2025-09-17 15:13:23 -06:00
JacobBarthelmeh 7c9f8f1758 refactor pty flag to Channel level and treat result as boolean in wolfsshd checks 2025-09-17 14:03:05 -06:00
JacobBarthelmeh 6fe09bdb35 do not treat shell as interactive until pty-req received 2025-09-16 10:31:38 -06:00
JacobBarthelmeh 73cf79e2ce clang scan-build warning fix 2025-07-25 11:32:02 -06:00
John Safranek 903bbc7fb2 Coverity: Argument cannot be negative
1. Due to not checking the result of fseek(), it is possible to try to
   malloc() -1 bytes of storage. Checking the return from fseek() and
   erring if negative.
2. Changing the check between the result of fseek() and fread() to match
   signedness. Adding some casting, as at that point the fseek() result
   is always positive.

Fixes CIDs:
  573009 572928 572868
2025-07-21 09:36:35 -07:00
John Safranek c641294fc3 Coverity: Buffer not null terminated
1. When copying the shell, leave a byte free in the dest buffer. Fill it
   with a null.

Fixes CID: 572891
2025-07-21 09:17:21 -07:00
John Safranek 4700799fcc Coverity: Dereference before null check
1. After getting the user's pw info, don't check that the shell value is
   null. We've already use it at that point.

Fixes CID: 572919
2025-07-21 09:17:21 -07:00
John Safranek 441f975ed6 Coverity: 'Constant' variable guards dead code
1. Remove the default password from the wolfSSH client app main
   function. It isn't set to anything. (It was originally an example
   client option.)
2. Remove handling the default password from the wolfSSH client app's
   user authentication callback.
3. Set the password size directly.
4. Changed a void typecast to WOLFSSH_UNUSED.

Fixes CID: 572898
2025-07-11 14:50:22 -07:00
John Safranek 538ae15310 Coverity: Resource leak
1. Fix some resource leaks during error conditions where a socket or a
   file descriptor doesn't get closed in all error cases.
2. In wolfSSH_SFTP_RecvOpen(), initialize the file descriptor.
3. For 572902, the error case resource leaks are fixed. There's still an
   issue to resolve for storing the FD for use later.

Fixes CIDs:
  572856 572902* 573012 573019 573021 573076
2025-07-11 14:06:46 -07:00
David Garske 055d024b2e
Merge pull request #776 from JacobBarthelmeh/wolfsshd
fix for FD_SET call on pipes and handling of channel EOF
2025-02-19 12:35:27 -08:00
JacobBarthelmeh 3859213936 use childFd when not handling a forced command 2025-02-19 12:00:38 -07:00
JacobBarthelmeh 60cd4bca73 redirect stdin with forced command 2025-02-19 10:32:08 -07:00
Andrew Hutchings a9c7ebc36d Fix SCP server side
SCP on the server side would get an EAGAIN around the 128KB mark, which
would trigger an error. That error in-turn would cause two attempts to
close the file, which would segfault.

Also fix inverted error return status on scpclient.
2025-02-19 11:13:42 +00:00
JacobBarthelmeh bbe3bac2d5 add regression test and use a better macro name 2025-02-18 10:50:05 -07:00
JacobBarthelmeh ab3622e672 fix for FD_SET call on pipes and handling of channel EOF 2025-02-17 10:07:39 -07:00
JacobBarthelmeh 34c3794396
Merge pull request #768 from LinuxJedi/client-crash
Fix crash when client has no hostname
2025-02-10 16:34:46 -07:00
Andrew Hutchings d108c69c5d Add cppcheck test to GitHub actions
Found and fixed:

* Fix typos in Renesas demo
* Fix uninitialized variable reads
* Fix redundant condition
* Fix argument checks
* Fix some null ptr dereferences
* Fix ambiguous statement
2025-02-05 19:49:01 +00:00
Andrew Hutchings 669bf92683 Fix crash when client has no hostname
If the client is not provided a hostname, `ClientPublicKeyCheck` would
crash trying to match `targetName`. A hostname is required.
2025-02-04 11:18:51 +00:00
JacobBarthelmeh c476e8846e refactor sshd test case script 2025-01-30 18:16:55 -07:00
JacobBarthelmeh c2fefec0eb add debug print out with test case 2025-01-30 17:42:44 -07:00
JacobBarthelmeh e4356dd6ed add test case 2025-01-30 17:31:05 -07:00
JacobBarthelmeh ce5b401ebd add regression test for closing down child on SSH connection issue 2024-11-26 12:01:23 -07:00
JacobBarthelmeh c8692f7570 kill child process after SSH connection failure 2024-11-25 16:36:54 -07:00
JacobBarthelmeh 6e70a07cfd fix for handling memory on socket timeout 2024-11-15 11:10:16 -07:00
Daniel Pouzzner d3a8ec6dc0
Merge pull request #743 from JacobBarthelmeh/sftp
keep trailing delimiter with SFTP open
2024-11-01 14:24:23 -05:00
JacobBarthelmeh 9e68977945 test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
John Safranek 8d1efe9fdf Testing Update
1. Update the sshd test to use the newer actions.
2. Parameterize the test for macos and ubuntu.
3. Parameterize the version of wolfssl used.
4. Parameterize the wolfSSH options used.
5. Update a couple test scripts to output their $0 variable instead of
   the wrong string.
2024-10-04 15:44:15 -06:00
JacobBarthelmeh 52e4e32529 keep trailing delimiter with SFTP open 2024-10-04 14:59:40 -06:00
JacobBarthelmeh b8e6f595b4 show version of wolfSSL linked to 2024-09-27 14:36:42 -06:00
John Safranek f51889430f
Merge pull request #732 from JacobBarthelmeh/scp_example
continue to cleanup on fail case and use WLOG for debug messages
2024-08-08 18:11:06 -07:00
JacobBarthelmeh 2fbe01092d account for partial sends 2024-08-05 14:48:51 -06:00
JacobBarthelmeh 15f4dc9d0f adjustments to test case 2024-08-05 13:31:47 -06:00
JacobBarthelmeh 781aa27582 touch up after rebase 2024-08-05 13:31:47 -06:00
JacobBarthelmeh 46832e46b4 add test case 2024-08-05 13:31:47 -06:00
JacobBarthelmeh 2722cb9da8 handle send retry when SSH window is full 2024-08-05 13:31:47 -06:00
JacobBarthelmeh fdecd765b9 continue to cleanup on fail case and use WLOG for debug messages 2024-08-05 13:23:04 -06:00
John Safranek a4f860d071 Release v1.4.18: Release Fixes
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.
2024-07-19 14:38:07 -07:00
John Safranek 1a6225671b Release v1.4.18: Release Testing Fixes (Windows)
1. For the ASCII and Wide versions of types and functions, make sure
   the wolfSSHd is being consistent using them.
2. In SFTP, use WSOCKETCLOSE to close the socket. Use the correct type
   for the socket.
3. Add parens around part of a ternary operator check to clear up some
   ambiguous order of operations.
4. Add a variable initializer for a COORD structure.
5. Add parameter checks to the Base16_Decode function.
6. Fix a double-freed handle.
7. Clean up a bunch of build warnings.
2024-07-19 12:03:32 -07:00
John Safranek e7ad7dd922
Merge pull request #722 from JacobBarthelmeh/sshd-windows
Fixes for SSHD Windows virtual terminal sequences
2024-07-17 14:06:37 -07:00
Daniel Pouzzner 01c1aadfba
Merge pull request #720 from ejohnstown/sshd-banner
SSHD Banners
2024-07-16 15:43:17 -05:00
Daniel Pouzzner e3bed88ead
Merge pull request #718 from ejohnstown/wolfsshd-closure
wolfSSHd Connection Closure
2024-07-16 15:41:50 -05:00
John Safranek 6c69c12bf7 wolfSSHd Connection Closure
1. Initialize all the fds to -1.
2. Add flags for peerConnected and stdoutEmpty.
3. Remove the idle counter.
4. When the socket would block on write, set a flag to check the socket for
   writing later to call the worker which will send pending data.
5. When reading the pipes, a 0 returns means the pipe is closed. Deal
   with that.
6. If the ssh write fails, interrupt the subordinate process.
7. When waiting for the peer to close its channel and shutdown, sleep
   for 100ms, rather than 1us. It takes a little while to tear down.
8. Shutdown the peer socket. Spin on receiving the peer socket until it
   closes or has an error.
9. Fixed a few function wrappers; was using Xname instead of Wname.
2024-07-16 10:50:12 -07:00
Lealem Amedie 5ea74bc22d Free resources 2024-07-15 17:19:20 -06:00
JacobBarthelmeh 89a24568a6 remove extra debug print outs 2024-07-12 01:02:33 -06:00
JacobBarthelmeh 25a0414378 handling virtual terminal sequences with exec command 2024-07-12 00:43:13 -06:00
Lealem Amedie b0cf4cfa5d Don't exit wolfSSHd daemon on recoverable fcntl failure 2024-07-11 16:56:39 -06:00
Lealem Amedie ff3e0177f7 Don't set banner unless specified in config 2024-07-10 15:06:51 -07:00
John Safranek 0f9e87357b
Merge pull request #715 from JacobBarthelmeh/examples
case of non-console ouptut handle
2024-07-10 11:20:32 -07:00
John Safranek 7fc63e86bf SSHD Banners
1. Add getting the banner option from the configuration file. Per the
   sshd_config(5) manpage, this is supposed to be a filename.
2. Load the banner file and set the banner into the CTX.
2024-07-08 10:02:41 -07:00
Eric Blankenhorn 0719578e29 Fix testsuite with singlethreaded 2024-07-01 09:12:36 -05:00
JacobBarthelmeh 816b314819 case of non-console ouptut handle 2024-06-24 13:52:17 -06:00
Anthony Hu 1697d603c0 Changes inspired by ejohnstown comments. 2024-06-03 14:40:52 -04:00
Anthony Hu 499a742097 improvements for ipv6 2024-05-31 17:32:20 -04:00
Anthony Hu 17a9ff4caa Fix compile error triggered by enabling TEST_IPV6 2024-05-27 17:09:00 -04:00
Sean Parkinson 9b29ba68cc
Merge pull request #666 from JacobBarthelmeh/progress_bar
refactor windows wolfsshd service to resolve powershell Write-Progress
2024-04-30 08:52:13 +10:00
John Safranek 6d51cc8278
Release v1.4.17: Release Testing Fixes
1. C++ build required some additional typecasting.
2. C++ complained about using the `= { 0 }` initializer, switched to
   `WMEMSET()`.
2024-03-22 17:09:01 -07:00
John Safranek 1736a4cabf
Update Copyright Date
1. Bring all copyright dates up to 2024.
2. Fix a few files with incorrect licensing.
2024-03-22 12:17:09 -07:00
JacobBarthelmeh 4ad5c5cd76 refactor windows wolfsshd service to resolve powershell Write-Progress 2024-03-12 10:18:42 -06:00
JacobBarthelmeh 5d3f8776ed add macro guard on windows version for VT 2024-03-06 09:49:42 -07:00
JacobBarthelmeh 9c7edce644 use windows terminal parsing for VT wolfssh.c 2024-03-06 09:06:28 -07:00
John Safranek 4193671164
Merge pull request #657 from JacobBarthelmeh/sftp_large
Fix for large file transfers on client side with SFTP
2024-02-15 17:39:56 -08:00
JacobBarthelmeh cd3130fa7e add large sftp file transfer test case 2024-02-15 09:32:58 -07:00
JacobBarthelmeh 46cdfc570d set pipes as non blocking before last read 2024-02-03 00:24:04 -07:00
JacobBarthelmeh 8ce9d164ca fix windows build with sshd 2024-02-02 09:46:41 -07:00
JacobBarthelmeh b662bcaaf1 fix return value for test shell scripts 2024-01-29 16:40:35 -07:00
JacobBarthelmeh 126a884aff adjust sshd test for user name 2024-01-26 14:35:50 -07:00
JacobBarthelmeh 521981ea1b check in x509 test script 2024-01-26 14:01:52 -07:00
JacobBarthelmeh ab45a98d18 fix for building with QNX 2024-01-26 14:01:52 -07:00
JacobBarthelmeh 2366417b06 increase type size for command name and improve handling read of pipes after command exits 2024-01-26 14:01:52 -07:00
JacobBarthelmeh 31ffa18492 account for last bit of left over data in pipes after command exits 2024-01-26 14:01:50 -07:00
JacobBarthelmeh 0a24dccd7f add additional x509 connection test 2024-01-26 14:01:11 -07:00
JacobBarthelmeh e8f34afe6e fix to only use stdout/stderr pipes with forced commands 2024-01-26 14:01:06 -07:00
JacobBarthelmeh b711d62238 add piping of stderr 2024-01-26 14:00:21 -07:00