Commit Graph

256 Commits (36760ba0ee441f8c4232de78dfc9d251f217d944)

Author SHA1 Message Date
John Safranek f75a60909a
Echoserver Driver
1. More tweaks for the threading guards.
2. Move a local declaration whose scope changed.
2022-11-01 15:26:22 -07:00
John Safranek e5a1c38d86
Echoserver Driver
1. Leave out the setup of the tcp_ready record when not using threading.
2. Don't change the echoserver directory when building for Integrity.
3. Change WEXIT to be a return(0) when building for Integrity.
4. The echoserver shouldn't call exit directly, it should save the
   return_code server args and then return to the caller.
5. When using forwarding, don't exit if the address is IPv6, return an
   error.
6. When exiting, close the listen file descriptor.
7. Reset myoptind to 0 before processing the options list.
2022-10-31 14:44:57 -07:00
John Safranek f0270d8920
Echoserver Driver
1. For Integrity builds, err_sys should only printf.
2. For Integrity builds, WEXIT should be a return.
3. In the echoserver, add explicit WEXITs for the err_sys statements.
2022-10-28 10:42:43 -07:00
John Safranek f25e5465e1
Echoserver Driver
1. Moved the contents of main to a new function, wolfSSH_Echoserver().
2. main just calls the wolfSSH_Echoserver().
2022-10-27 11:26:04 -07:00
Hayden Roche c88fa45d3d
Merge pull request #471 from ejohnstown/thread-dedup 2022-10-24 15:04:10 -07:00
John Safranek f88c3d6d3a
Dead Code Removal
1. In the echoserver's user authentication function, the summary check was
   refactored and the old code wasn't removed. A more strict compiler
   noticed the code was never executed.
2. Moved the ret check variable to the section of the function where it
   is used.
2022-10-21 15:54:34 -07:00
John Safranek 1fa4134304
Threading Deduplication
1. Move the test threading types and macros to the conditional threading
   section of test.h and make them conditional on wolfSSL v5.5.1.
2. Alias WOLFSSL_THREAD as WOLFSSH_THREAD.
3. Update the THREAD_FUNC typdef to look more like a function pointer.
4. Add the user_settings.h/options.h include that is missing from
   examples.
2022-10-21 15:17:19 -07:00
John Safranek d8e3288dd6
Merge pull request #465 from JacobBarthelmeh/Certs
renew cert script, add check for user name in UPN and host IP in alt. names
2022-10-21 09:43:58 -07:00
John Safranek a7c7830dcd
Automake Refactor
1. Remove the DISTCLEANFILES variables from automake scripts. The items
   they clean are already cleaned appropriately.
2. For application targets, move the local headers to the SOURCES lists
   for the apps.
2022-10-20 11:35:59 -07:00
JacobBarthelmeh 0f9304d70d update client macro guard and add small stack dcert 2022-10-19 12:52:59 -07:00
Jacob Barthelmeh 9e3c2f3b78 check on user name in UPN if exists
add check on host IP address in certificate alt names
2022-10-10 08:29:50 -07:00
John Safranek e983ae0ad9
Multiple Server Keys
1. Allow user to add multiple server keys to the CTX up to a limit.
2. Clear the list of server's keys when releasing the CTX.
3. Update the API test case.
4. Server key algo list based on keys loaded.
5. Server uses key requested by client.
6. Change echoserver to load ECC and RSA key, -E option to select order.
7. Added a function to identify keys, and another to identify certs.
8. Added a function to add keys or certs to the list of keys and certs.
9. Fix return value for MAC Algo C2S match fail to the correct value.
2022-10-07 15:35:35 -07:00
John Safranek b816ac5fe8
SFTP List
Updated from peer review comments.
2022-09-20 11:53:56 -07:00
John Safranek a48926b0dd
SFTP List
1. Update wolfSSH_SFTPNAME_readdir() to have a special case getting
   the drive letters at root in Windows.
2. The Win32 APIs can use forward slashes, but cannot have one at the
   beginning of the path before the drive letter. Add a trim function
   to remove the leading slash in the SFTP paths.
3. Update echoserver to always set the default SFTP path to either the
   provided command line option or to the CWD for the echoserver run.
4.  Get the RealPath for the default path
5. Tweak wolfSSH_RealPath() to handle some Windows cases.
6. Added more test cases.
2022-09-16 14:17:31 -07:00
JacobBarthelmeh 3e1a6ff342 add mutual X509 auth of host key and sshd_config parsing additions 2022-09-06 16:15:34 -07:00
John Safranek c1aabbdd87
Old Compiler Warning Cleanup (GCC 4.0.2)
Fixed a few "possibly used uninialized variable" warnings.
2022-09-06 09:10:50 -07:00
Hayden Roche 8cda0c4cc9
Merge pull request #445 from ejohnstown/wildcard 2022-08-29 17:44:45 -07:00
John Safranek 79ddd784c7
Scan-Build Cleaning
1. The portfwd example had a couple spots in command line option
   processing where atol could get called with a null pointer.
2022-08-29 17:13:12 -07:00
JacobBarthelmeh 5d8922e5a2 update readme for certs., add examples certs. to include.am, update comment in example 2022-08-26 23:41:50 -07:00
JacobBarthelmeh e40e852bc2 handle certificate chains 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 69e1cde58f update macro guard in echoserver 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 71d7f9c8cc more return code checking 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 8fa67a041b add argument to client for loading certificate 2022-08-24 06:35:40 -07:00
JacobBarthelmeh c507c77431 add UUID and FASC-N 2022-08-24 06:35:40 -07:00
John Safranek f929c5e0b6 Added RSA cert support 2022-08-24 06:35:40 -07:00
John Safranek 13e525478c X.509 Certificate Support
1. Quality of Life improvements to echoserver: command line user config
2. adding policy checking
2022-08-24 06:35:40 -07:00
John Safranek a8fa38d7f8 OCSP Lookups
1. Changed to use the new set of certs.
2. Do an actual cert check and report errors.
3. Do an actual OCSP lookup and report errors.
2022-08-24 06:35:40 -07:00
John Safranek 1405eeae62 X.509 Certificate Support
1. Fix build error when building without certificates.
2. Add the root CA option to the echoserver usage.
3. Update the readme file to include the new certificate option.
4. Added command line option to load a CA cert into the echoserver.
2022-08-24 06:35:40 -07:00
JacobBarthelmeh 20ace73349 fix new scan-build warning 2022-08-22 18:09:07 -06:00
Jacob Barthelmeh 92d1f39065 update copyright date 2022-08-17 16:58:21 -06:00
John Safranek 511a022833
Merge pull request #435 from JacobBarthelmeh/sshd
Alpha version of SSHD support with wolfSSH
2022-08-16 16:22:55 -07:00
John Safranek a0da4e3cc5
Merge pull request #431 from JacobBarthelmeh/sftp
handle files with . in name and fix for window resize want write case
2022-08-10 13:30:35 -07:00
Jacob Barthelmeh 5806d28dd2 check for null port value 2022-08-09 13:24:58 -06:00
JacobBarthelmeh dba42d3dc7 Non-blocking SFTP and SSH fixes, handle edge case with files having '.' in name, alter want write case to return consumed size 2022-08-08 13:43:34 -07:00
Eric Blankenhorn 90625af050 Add WIN time support in SFTP client 2022-07-28 15:58:18 -05:00
JacobBarthelmeh 7b8ce149d7 add look for libpam and adjust for QNX build 2022-07-21 13:31:22 -07:00
JacobBarthelmeh 3013eee8cb handle pending sent packets with SFTP and want write case with rekey 2022-07-14 09:17:43 -07:00
John Safranek 6bc47eef77 No User
1. In the echoserver, add a print to the case where a user doesn't exist
   in the system.
2022-05-25 14:21:50 -07:00
John Safranek b34f144814
Preprocessor Guards
1. Add preprocessor guards for RSA/ECC to agent and the example and test
applications.
2. Remove redundant copy of FwdStates from internal.h.
2022-04-05 11:02:23 -07:00
David Garske 509851e64e
Merge pull request #398 from ejohnstown/status
Echoserver SFTP status update
2022-03-25 14:45:56 -07:00
John Safranek b94349bbc5
Echoserver SFTP status update
1. In wolfsftp, treat all the status codes the same when trying to read.
2. In the echoserver, treat all the status codes the same in the
   sftp_worker.
2022-03-24 16:55:12 -07:00
David Garske 0f22329187 Fix for FIPS 140-3 on ECC private key use. Fix for IPv6 with scpclient. Wrong macro for fall through. Add support for flushing file IO using `WOLFSCP_FLUSH`. 2022-03-24 13:34:26 -07:00
John Safranek 17008c635e
Merge pull request #394 from anhu/prevent_false_timeout
Clean out the currentFile file name ensuring reset of the timeout value
2022-03-21 15:40:34 -07:00
Anthony Hu e1949d2fd6 Clean out the currentFile file name to ensure reset of the timeout value. 2022-03-21 17:43:51 -04:00
John Safranek 981b8e8b30
SFTP Channel Receive Fix
1. The echoserver's sftp_worker() was treating the WS_CHAN_RXD status as
   an error and failing out. Updated to clear the error status.
2. wolfSSH_SFTP_read() was also treating WS_CHAN_RXD status as an error
   and terminating the transfer. Update to treat like the other status.
2022-03-21 14:39:52 -07:00
John Safranek bd312c34f2
Old Compiler Warning Cleanup (GCC 4.0.2)
1. client.c: It was warning a recommendation to tag the function
   `readInput()` as non-return. Changed the err_sys() calls to
   `fprintf(stderr, ...)` and then return from the function.
2. internal.c: In functions `DoKexInit()` and
   `DoUserAuthRequestPublicKey()`, initialized a couple variables that
   could be used uninitialized.
3. wolfsftp.c: Fixed a variable that was shadowing a global label.
4. wolfsftp.c: In function `wolfSSH_SFTP_RecvFSTAT()`, initialized a
   variable that could be used uninitialized.
5. scpclient.c: The command line argument was read into a char value
   assuming it was signed, which is usually true. On the PowerPC this
   value is unsigned. Promoted it to int to match the other tools.
2022-01-27 10:36:51 -08:00
John Safranek 796423bfac
Update tests and examples to include config.h
1. All the sources for the tests and examples did not have an include
   for config.h. This fixed some inconsistent builds with an older
   version of gcc.
2. Moved config.h from the src directory to the top level of the repo
   directory.
2022-01-26 15:06:07 -08:00
Jacob Barthelmeh ba99ddda68 run license update script 2021-11-04 13:11:53 -06:00
Jacob Barthelmeh db00600628 fixes for warnings from scan-build 2021-11-04 09:43:53 -06:00
John Safranek f95e0995cc
After sending the shutdown messages, client needs to wait for the server to respond before closing its socket. 2021-10-07 15:28:40 -07:00