Commit Graph

131 Commits (8d97ee9250d4b83fefa0479a99516da45e31ad45)

Author SHA1 Message Date
John Safranek ac762368ac Fix keyboard-interactive without TERM
Keyboard-interactive was unusable in builds with
WOLFSSH_KEYBOARD_INTERACTIVE but no WOLFSSH_TERM, in two ways.

- ClientFreeBuffers declared 'entry' under TERM && KBI but used it
  under KBI alone, so KBI-without-TERM failed to compile; widen the
  declaration guard to match the use
- ClientUserAuth's keyboard-interactive branch is guarded on
  TERM && KBI, so without TERM a keyboard-interactive request fell
  past every branch and returned the initial WOLFSSH_USERAUTH_SUCCESS
  with no responses populated. There is no terminal to prompt on, so
  answer WOLFSSH_USERAUTH_FAILURE instead of claiming success.
2026-07-14 13:58:43 -07:00
Yosuke Shimizu 331b2c4c97 examples/client: add cert-name length bounds check in ParseRFC6187 2026-07-08 23:36:25 -07:00
Yosuke Shimizu c8a347de85 Reject symlinks in default SCP send callback 2026-06-23 14:37:57 -07:00
Yosuke Shimizu 12d39dd970 examples/client: guard rxBuf indexing against negative stream_read error 2026-06-09 09:34:14 -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 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 f85ec920e3 Client rsa-sha2-512
1. Separate the key type and signature type when handling user
   authentication. ssh-rsa is a key type used with rsa-sha2-256 and
   rsa-sha2-512 signatures, along with ssh-rsa signatures.
2. Allow rsa-sha2-512 to be used.
3. Fix bug where setting the key algorithm on the client command line
   was setting the list to NULL.
4. Fix bug where adding rsa-sha2-512 to the list of canned algorithms
   was terminating the list, rather that adding it.

Issue: ZD-21247
2026-03-09 10:56:37 -07:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
John Safranek 8951bd9209 Release v1.4.22
1. Update copyright date to 2026.
2025-12-29 16:53:33 -08:00
JacobBarthelmeh 4862400a37 fix spelling issues and SFTP send state 2025-10-06 00:42:05 -06:00
JacobBarthelmeh af45bc3719 update example client for rekey and sanity check on window update after read attempt 2025-08-26 10:50:14 -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 0f650789de Soft Disable AES-CBC
1. By default, soft disable AES-CBC. It isn't offered as a default
   encrypt algorithm, but may be set at runtime.
2. Add guard where AES-CBC can be added back as a default.
3. Add option to example client to run it with a custom encrypt
   algorithm list.
4. In the client, add macro to add items to the arg lists while checking
   the number of items in the list.
2025-05-16 11:41:52 -05:00
Andrew Hutchings c368efb8b2 Make Keyboard Interactive a compile time option
Now an off-by-default compile-time option. This saves resources and
confusion if you are not expecting it.

ZD #19704
2025-04-22 13:12:42 +01:00
aidan garske a52c3b120e Used W port.h file operations for keyblob and added username argument so can append any username needed. 2025-04-02 10:33:27 -07:00
aidan garske 77c8db6cc2 Rebase for tpm public key authentication with wolfssh 2025-04-01 16:44:55 -07:00
Andrew Hutchings a4733ecd95 RFC-4256 Keyboard-Interactive authentication
This implements Keyboard-Interactive authentication.

Adds an additional callback set by `wolfSSH_KeyboarAuthPrompts()` which
will set a callback in the server to ask the application to provide the
prompt details for the client.
2025-02-11 14:19:52 +00:00
JacobBarthelmeh 9e68977945 test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
JacobBarthelmeh b8e6f595b4 show version of wolfSSL linked to 2024-09-27 14:36:42 -06:00
JacobBarthelmeh 781aa27582 touch up after rebase 2024-08-05 13:31:47 -06: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
John Safranek d6d67c889c Static Memory
1. In the echoserver, change the names of the defines for the
   static memory values.
2. Modify the client common functions for keys and certs to take a heap
   value for their allocations.
3. Update the client's use of the common key and cert function calls to
   pass NULL for the heap.
4. Add a static memory description for the sftp client code.
2024-04-26 10:21:29 -07: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 5d3f8776ed add macro guard on windows version for VT 2024-03-06 09:49:42 -07:00
JacobBarthelmeh e137865ab2 use windows terminal parsing for VT 2024-03-06 09:01:48 -07:00
JacobBarthelmeh bb9efdcb5c use WOLFSSL_RETURN_FROM_THREAD in example client 2024-03-05 08:02:06 +07:00
JacobBarthelmeh e617e20e7a example set key algos 2024-03-05 05:14:33 +07:00
JacobBarthelmeh 8b7a15f0fd check for channel closed on shutdown 2024-02-22 07:44:24 -08:00
John Safranek 815d22f729
Merge pull request #650 from miyazakh/no_rsa
fix WOLFSSH_NO_RSA
2024-01-31 13:20:53 -08:00
Hideki Miyazaki b256522f5b
fix WOLFSSH_NO_RSA 2024-01-27 13:03:10 +09:00
JacobBarthelmeh ab45a98d18 fix for building with QNX 2024-01-26 14:01:52 -07:00
JacobBarthelmeh 903bc98c34 update example client shell settings 2024-01-26 14:01:52 -07:00
JacobBarthelmeh 7d2b4c5e39 fix typo in macro guard 2024-01-22 15:10:53 -07:00
JacobBarthelmeh 0d480fa419 adjust shutdown for sending exit status cleanly 2024-01-19 09:18:41 -07:00
JacobBarthelmeh afe109acf8 client side handling of exit-status packet 2024-01-19 09:18:41 -07:00
Juliusz Sosinowicz 37412ff50f Init zephyr support
- SSH
- SFTP
- SCP
2023-10-02 20:38:21 +02:00
JacobBarthelmeh 5780570880 limit additional nonblocking test 2023-09-29 16:12:21 -07:00
JacobBarthelmeh a650415476
Merge pull request #582 from danielinux/fix_no_term
Fix compile errors when WOLFSSH_TERM is undefined
2023-09-25 09:45:18 -06:00
John Safranek 481c334a39
Fix No Term
1. Widened the scope of a couple of the guards for WOLFSSH_TERM.
2. Added a pthread_join for one of the threads in the example client.
2023-09-22 16:26:23 -07:00
John Safranek 5b094d6f43
Term Update
1. Change GetTerminalSize() to GetTerminalInfo().
2. Add the term variable to the things GetTerminalInfo() looks up.
3. Return the actual value of the environment variable TERM to the
   server. If one isn't present, default to "xterm".
4. Clean up the whitespace in SendChannelTerminalRequest().

Misc other changes:
1. Cleanup whitespace in the recently added function
   SendChannelOpenFail().
2. Add labels to the parameters in the prototype for
   SendChannelOpenFail().
3. Remove the CR addition for Windows in the example client. Causes the
   enter key to double-strike.
2023-09-19 11:40:23 -07:00
Daniele Lacamera 7ff76751f6 Fix compile errors when WOLFSSH_TERM is undefined 2023-09-18 08:23:30 +02:00
John Safranek 526ade03df
Linux-Semaphore
1. Made a similar change for Linux semaphores.
2. Moved the check for the quit flag in the windowMonitor.
2023-09-14 16:46:06 -07:00
John Safranek 503e1bb288
Mac-Semaphore
1. Add quit parameter to the example client's thread_args structure.
   This will be used to let the windowMonitor thread know the
   application is quitting.
2. If the windowMonitor's quit flag is set, it will exit and not call
   wait again.
3. Join the windowMonitor thread rather than cancel it.
2023-09-14 16:30:44 -07:00
John Safranek f35a92fd48
Nonblock Client Login Failure
When the example client is using non-blocking sockets, sometimes they
don't block. The monitor thread on the socket wasn't handling
WS_WANT_READ explicitly, and treated it as a fatal error. It should be
reset to WS_SUCCESS.
2023-09-13 09:26:29 -07:00
JacobBarthelmeh 57519c6a54
remove extra newline in debug message 2023-09-07 13:28:43 -06:00
JacobBarthelmeh 6e5b3c00d2 use WLOG for debug messages when checking peer IP address 2023-09-06 11:03:45 -07:00
John Safranek d4fa4ebd69
Merge branch 'master' into pull-reqs/f4021bb_All_the_filesystem-related_W_macros_accept_a_filesystem_context_pointer_as_first_parameter 2023-09-01 09:08:34 -07:00