Commit Graph

369 Commits (master)

Author SHA1 Message Date
JacobBarthelmeh 1422697e43 add check for want write in example echoserver to handle new test case 2025-05-20 16:55:42 -06:00
JacobBarthelmeh 71cda6d16c add test case for want write return from highwater callback 2025-05-20 15:18:27 -06: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
Anthony Hu 03afce7236 Forgive a socket error 2025-04-03 19:19:36 -04: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 69e266178f Used port.h macros 2025-04-01 21:58:49 -07:00
aidan garske 77c8db6cc2 Rebase for tpm public key authentication with wolfssh 2025-04-01 16:44:55 -07:00
Andrew Hutchings 08759f1943 Add FATFS Linux example
This allows a file on the Linux filesystem to be used as a FATFS file.

It also fixes a bug in `port.h` when opening file on a FATFS filesystem.
2025-02-27 12:18:05 +00:00
devin-ai-integration[bot] 76e8b9f4ea
Update SFTP status callback to output once per second (#779)
* Update myStatusCb to output once per second

Modified the myStatusCb function in sftpclient.c to only output status
updates once per second by tracking the last output time and comparing
it with the current time. This reduces the frequency of status updates
while maintaining all existing functionality.

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Reset status output timer when starting new file transfer

When starting a new file transfer, reset the lastOutputTime to ensure
the first status update for the new file is shown immediately.

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Fix Zephyr build by guarding lastOutputTime with WOLFSSH_NO_TIMESTAMP

The lastOutputTime variable is only used when timestamps are enabled,
so it should be guarded by the same macro to avoid unused variable
warnings in builds where timestamps are disabled.

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Move elapsedTime declaration to function scope

Per wolfSSL coding standards, declare all variables at function scope.
Added comment explaining that modern compilers optimize variable access
regardless of declaration placement.

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Fix timeout check to use elapsed time instead of current time

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Use elapsed time in timeout error message for consistency

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Move elapsedTime inside WOLFSSH_NO_TIMESTAMP guard

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

* Move currentTime outside WOLFSSH_NO_TIMESTAMP guard

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: andrew@wolfssl.com <andrew@wolfssl.com>
2025-02-26 16:54:21 -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
Andrew Hutchings f73a76e064 Add DH Group 16 and HMAC-SHA2-512
This adds the `diffie-hellman-group16-sha512` key exchange and
`hmac-sha2-512` mac support.

Echoserver can now take `-x` for key exchange and `-m` for mac setting,
 and `-c` for cipher so that this can be used in the test suite.
2025-02-12 07:06:51 +00: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
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
JacobBarthelmeh 71301530a1 SCP client continue on to free struct's after failure 2024-11-08 11:18:29 -07: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
John Safranek dc2065719f Release v1.4.18: Release Testing Fixes
1. Fix echoserver's load_file function. Could potentially dereference
   null if a file size is passed in, but using a null buf to get the
   file's size only.
2024-07-18 14:44:03 -07:00
JacobBarthelmeh 816b314819 case of non-console ouptut handle 2024-06-24 13:52:17 -06:00
John Safranek c1e5af49dc Echoserver Refresh
1. Add the code from wolfsshd that initially sets up the terminal
   settings to the echoserver.
2. Add the WOLFSSH_TERM flag to the build of the echoserver.
2024-06-20 15:38:37 -07:00
JacobBarthelmeh 23a9333b2d add check for channel closed error 2024-06-10 15:54:42 -06:00
John Safranek 524b5c6052
Merge pull request #702 from JacobBarthelmeh/scp_example
adjust scp error return checking for closed channels
2024-06-05 15:30:15 -07:00
John Safranek 3024d28270
Merge pull request #695 from JacobBarthelmeh/541
Server side auth pending support
2024-06-05 15:27:36 -07:00
David Garske b6ccb07de4
Merge pull request #703 from anhu/ipv6_part2
improvements for ipv6
2024-06-03 16:22:16 -07: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
Juliusz Sosinowicz 6de1230e6b scpclient.c: correct call to wolfSSH_SetPublicKeyCheckCtx 2024-05-31 17:06:34 +02:00
JacobBarthelmeh c3aaa6e570 adjust scp error return checking for closed channels 2024-05-29 13:44:58 -06:00
JacobBarthelmeh dc66602e12 add example auth pending 2024-05-17 16:11:30 -06:00
JacobBarthelmeh ebfd175bf1 add example and account for curve25519 / kyber1 2024-05-17 14:51:46 -06:00
John Safranek 2e1ca68652 Static Memory
1. Update the scpclient's use of the common key and cert function calls to
   pass NULL for the heap.
2024-04-26 10:21:29 -07: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 559f24b476 Static Memory
1. Change the static buffer for the echoserver and the memory
   descriptions to be static values.
2. Fixed a double-free on the memory statistics.
2024-04-26 10:21:29 -07:00
John Safranek 6a65f16083 Static Memory
1. Modify the echoserver to use a static memory pool when using the flag
   WOLFSSH_STATIC_MEMORY. Uses NULL otherwise. The WOLFSSH_CTX is
   created with the pool and subsequent allocations for the WOLFSSH
   server use the same pool.
2. Add a configuration for the memory pool. Only works with SFTP
   enabled.
3. Add the memory pool use statistics to the echoserver.
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 902cff345f
Merge pull request #667 from ejohnstown/sftp-fix
SFTP Fix
2024-03-19 00:21:38 +07:00
John Safranek 76e8d66289
SFTP Fix
1. Remove the continue from the SFTP worker loop when there's a timeout
   on the select and when there's a want_read from the wolfSSH_worker.
2. When the select has receive data ready, check it. Don't make it
   conditional on want read as well.

The goal is that when there isn't data waiting on the socket, check and
process the data in the SFTP channel's buffer, always.
2024-03-13 15:08:07 -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