Commit Graph

50 Commits (12b6a0e6d87cf00f1ac9b27591534d199ba784b7)

Author SHA1 Message Date
John Safranek bbd3d76291
Add some option disables to the api test and the echoserver. 2021-02-02 11:45:21 -08:00
John Safranek 717ea6a050
Separate the ECC disable into ECDSA and ECDHE disables. 2021-02-02 10:58:04 -08:00
John Safranek ee139f8e0d
Merge pull request #291 from JacobBarthelmeh/sftp
add special case for real path and refactor clean_path
2020-11-09 09:02:03 -08:00
Jacob Barthelmeh 7acf574001 add test case for updated realpath 2020-11-09 22:54:38 +07:00
John Safranek 4d5ce88cc9
More Options
Wrapped more items with guards to disable them if not usable.
2020-10-13 17:42:02 -07:00
John Safranek b63d3c4914
More Options
Added many more guards for algorithms that may be disabled in wolfCrypt
including DH, AES-GCM-CTR-CBC, SHA1, ECC, RSA, etc.
2020-10-13 17:42:02 -07:00
John Safranek 39f30e25a4
Optional RSA
1. If RSA is disabled in the wolfCrypt build, the RSA related code
   in wolfSSH shall be disabled.
2. Examples will force themselves to use ECC if RSA is disabled.
2020-09-04 15:28:25 -07:00
John Safranek 1250e1f9d8
SSH-AGENT
1. Added the agent support to the configure.ac script.
2. Updated the gitignore file to ignore any stamp-h file.
3. Changed to use the parsing functions and to make the parsing functions
   local.
4. Updates to multichannel.
5. Add -lutil only if needed.
6. Add configure checks for some headers that change based on target OS.
7. Bump version.
8. Test doesn't have real account or real key so agent doesn't test well.
2020-07-15 09:29:49 -07:00
John Safranek 49bd9ad518
Shell Worker
1. Fixed issue with the testsuite failing when the shell is enabled.
2. Added option to echoserver to force the echo behavior instead of
the shell when shell is enabled.
2020-07-08 12:02:27 -07:00
John Safranek cb277a92fc
Error Codes
1. Rename an error code that was prefixed with WC_ instead of WS_.
2. Add a new error code for missing callbacks.
3. Remove a redundant error code. Channel pending appeared twice.
4. Fix the error code vs string test.
2020-03-12 13:30:08 -07:00
John Safranek 7c8ae04b44
VxWorks Customizations
Also includes some bug fixes.
1. Add a function that returns a pointer to a session's username string.
2. Add a function to set a "raw" username copied from an incoming packet.
3. Add tests for 1 and 2.
4. Server saves a copy of the username on successful authentication.
5. Fix bug with GetString() where it would choke on a 0 length string.
6. Clean up the termios macros and mode creation.
7. Add some options for when WOLFSSL_VXWORKS is set.
2020-02-18 16:01:00 -08:00
Jacob Barthelmeh 31131c0e03 public key vs password is now decision of user callback 2020-01-27 10:33:28 -07:00
Chris Conlon 83f8372458 update copyright to 2020 2020-01-03 15:16:47 -08:00
John Safranek cacd19819b
Maintenance
1. Clean up some scan-build complaints from the unit test. It was
potentially using memory after it was freed.
2019-12-05 13:43:46 -08:00
Jacob Barthelmeh ef47ac7796 filter out directories in test case 2019-08-20 14:06:32 -06:00
Jacob Barthelmeh e590ee3445 account for smaller files in test case 2019-08-20 13:36:35 -06:00
Jacob Barthelmeh 864908b65a add test case for wolfSSH_SFTP_SendReadPacket 2019-08-20 13:24:19 -06:00
John Safranek 97df8b56d1 Unit Testing
1. Added API test for wolfSSH_CTX_UsePrivateKey_buffer().
2. Added the string->binary code to the API test.
3. Fixed a bug in UsePrivateKey(). When loading a new key into a CTX that already has a key, also reset useEcc.
4. Added a test case for wolfSSH_new() returning a null.
5. The test tools can find the -D flags for SFTP and SCP.
2019-05-10 11:04:20 -07:00
John Safranek 09b4c60c83 fd Fix
The API test assert was using an int comparison. Revised to use a local
check value and just use an AssertTrue for the comparison.
2019-04-26 09:41:13 -07:00
John Safranek c2873009e9 fd Fix
POSIX uses an int for a file descriptor. In Windows, they use a SOCKET
type which isn't an int, it is a unsigned long. Changed the types of
the file descriptors to a WS_SOCKET_T, which is either an int or a
SOCKET. Added a unit test.
2019-04-26 09:22:34 -07:00
John Safranek 9aaebbb146 Update the copyright to 2019 2019-04-08 10:24:08 -07:00
John Safranek 1d051e1a84 Memory Update
1. Renumbered the dynamic memory type IDs so they don't conflict with wolfCrypt/wolfSSL.
2. Renumbered the error codes so they don't conflict with wolfCrypt.
3. Fixed a couple of typos when using dynamic memory type IDs that were missed due to default memory handling being used.
2019-04-05 11:36:25 -07:00
Jacob Barthelmeh ff84dea8a0 add function to get extended data and example remote command execute
update client example remote command execute for Windows

add wolfSSH_stream_peek and console translation

improvements to console translation and add client side psuedo terminal

windows client -c fix, clang build, sanity check on side for exec

fix for warnings with VS 2010 build

cast return value of WSTRLEN

update termios guard and fix for scan-build check

advance extended data buffer index on read

fix for error.h after rebase
2019-03-29 09:25:27 -06:00
Jacob Barthelmeh 3a2da4bb0e account for order of test listing directory 2019-02-19 15:44:56 -07:00
Jacob Barthelmeh aa7330f7fc nonblocking chmod, add chmod sftp test 2019-02-07 17:51:52 -07:00
Jacob Barthelmeh d0a7e69487 adjustement to sftp test and fix typo 2019-02-07 12:12:30 -07:00
John Safranek accd3c299d Add a function to assign-add a 32-bit value to a 64-bit value. The
64-bit value is an array 2 of 32-bit values. In SFTP, changed up all the
uses (most) of word64 to word32 arrays. Not all systems we support have
64-bit types available.
2019-02-06 14:31:31 -08:00
Jacob Barthelmeh a92bcdc074 add test cases for more SFTP commands 2019-02-06 13:45:18 -07:00
Jacob Barthelmeh a268085b0b cast return value of wstrlen 2019-02-04 14:53:45 -07:00
Jacob Barthelmeh 55a763c360 add missing testsuite.h file 2019-02-04 14:49:56 -07:00
Jacob Barthelmeh 9c73700f25 add SFTP tests to testsuite 2019-02-04 12:22:31 -07:00
John Safranek 42675723e2 Fixed some issues with NO_WOLFSSH_SERVER builds. wolfSSH proper still
has the server code, but the wolfSFTP code excludes the server side.
2019-01-09 13:14:25 -08:00
John Safranek d8797b07f8 Add the function wstrcat() which acts like strncat, but adds an extra
check for space in the destination and will fail instead of truncating
the string.
2018-12-03 16:27:45 -08:00
John Safranek b97b237695 Static Analysis Fixes
Ran the clang static analysis and infer and fixed most of the reported
items. There were many that infer found that looked like false
positives.
2018-11-15 13:28:42 -08:00
John Safranek bbf818c587 also added test-locking group. tweaked misc.c, misc.h so they played nice with NO_INLINE 2018-09-20 16:19:25 -07:00
John Safranek cf959db741 Grouping test header functions into test-client, test-server, or
test-threading blocks. Adding flags to the examples and testsuite to
enable various test functions.
2018-09-20 16:10:13 -07:00
John Safranek 8a13a829df scan-build fixes
1. Didn't initialize errFd before calling select() in wolffwd.
2. Wasn't checking the accepted appFd in wolffwd.
3. For the test_KDF() unit test, a call to ConvertHexToBin() could succeed and leave eKey NULL, and pass it to memcmp().
2018-09-13 17:19:39 -07:00
John Safranek a42075d823 TCP/IP Forwarding
1. Removed some unused macros in the configure.ac script.
2. Added option for enabling TCP/IP Forwarding.
3. Coalesced the option enable checks to one location in the configure script.
4. Removed redundant compile flags from the wolfSSH automake include.
5. Added a check of the BUILD_SCP option to leave out the wolfcsp file as needed.
6. Removed the redundant debug flags from the ax_harden macro since we add them at the configure level.
7. Modified the ax_harden macro to add the flags to AM_CFLAGS rather than CFLAGS.
8. Removed redundant AM_CFLAGS from the include.am that are adding them to their build's CFLAGS.
9. Replaced the have-wolfssl macro with AC_CHECK_LIB.
10. When adding per-target CPPFLAGS, add the AM_CPPFLAGS back in.
11. remove redundant call to wolfSSH_Init() from echoserver
12. Add runtime configuration of the session window size and max packet size.
13. Parse the TCP/IP direct connect flavor of the Channel Open message.
14. Save and release the host and origin addresses.
15. Added an example forwarding tool.
16. Move and rename the FIND_SELF and FIND_PEER constants.
17. Add planned functions ChannelSend, ChannelRead, ChannelExit, worker.
18. Add new function ChannelNext, which returns the next channel in the list.
19. Changed SendBuffered() from static to local so it could be used by the worker.
20. Separated creating a channel and sending an channel open request.
21. Added status code for pending open channel and for received data.
2018-08-31 11:21:42 -07:00
John Safranek f08628af2b Scan Build Fixes
1. In the echoserver, free the thread context before exiting app on error.
2. In the unit test, when checking the KDF, initialize the sizes to zero
and the pointers to NULL after freeing them.
2018-08-15 12:38:20 -07:00
Jacob Barthelmeh a631cf5794 add SCP functions to api tests 2018-07-02 12:04:00 -06:00
John Safranek 3ab6f4fbd1 reroll the error string test to check for unknown string and to count the inner loop correctly 2018-06-06 16:02:39 -07:00
John Safranek 8477c4acd6 fix a handful of clang static analysis warnings 2018-06-06 15:04:59 -07:00
Chris Conlon f37c7224fb fix threading in example server 2018-05-31 13:45:53 -06:00
John Safranek c77345fc6c Error Code Unit Test
1. Add a unit test to check all error codes have strings.
2. Add public function to return the error string for an error code.
3. Fill in the missing error strings.
4. Fix an error string (change a "verify" to "create").
2018-05-10 13:55:59 -07:00
John Safranek 16b4a31cfb Test Suite
1. Add an automated test suite.
2. Refactor the existing test and example code to be better components for the test suite.
3. Rename some of the internal functions used by the examples and test suite.
4. Echoserver now only handles one connection at a time, has option to exit after single connection.
5. Echoserver can do the port zero trick for the test suite.
6. Some whitespace changes.
7. Added a `(void)` to a variable to hush an unused assignment warning.
2017-09-29 13:48:40 -07:00
John Safranek 1498bc5409 IDE Support
1. Added Windows Visual Studio build solution. Includes projects for:
 * wolfSSH static library
 * echoserver
 * unit-test
 * api-test
 * 32- and 64-bit debug and release builds for all
2. Made necessary tweaks including adding some wrapper functions so the code compiles for both Linux/macOS and Windows.
3. Fixed a bug in the KDF test where the output buffer wasn't updated when SHA-256 was added.
4. Added the fallthrough attribute for GCC7.
5. Replaced all uses of `uint8_t`, `uint16_t`, and `uint32_t` with the wolfCrypt provided `byte`, `word16`, and `word32`.
6. Split the new channel function into new and init.
7. Added some ECC keys for authentication testing.
8. Moved some functions and includes around.
9. Removed the keying state machine and replaced with a flag.
10. Added rekey trigger if the client sends *CTRL-F* to echoserver.
11. Moved the sequence number increase outside `CreateMac()`. Incremented if the packet was successfully created. This way the sequence number is incremented when using AES-GCM.
12. Removed the redundant function `SendText()`.
13. Renamed the `clientId` related functions and data members to `protoId` to keep things role agnostic.
14. Changed all references of `clientKey` and `serverKey` to `keys` and `peerKeys`.
15. Updated `GenerateKeys()` to generate `keys` and `peerKeys` appropriately based on the endpoint side.
16. Added the wolfSSL style _test.h_ file to group shared example functions in one place.
17. Changed the echoserver to be similar to wolfSSL's where the code may be included without the main function in another executable.

Note:
This commit is a squash of more than a dozen commits. IDE support was added to the client branch, but the client branch is on hold. There were many changes in the client branch that are needed going forward. The code at the head of the client branch was copied over to the IDE branch, and the client code either deleted or removed from the build.
2017-09-12 14:42:23 -07:00
John Safranek 9c8a77c240 1. Add a separate API test.
2. Eliminate the unit.h file, included into api.c.
2017-06-14 09:10:35 -07:00
John Safranek 24b19daa16 1. Copied over some of the test infrastructure from wolfSSL.
2. Added API test cases for only wolfSSH_Init and wolfSSH_Cleanup.
2017-06-13 10:35:11 -07:00
John Safranek c3d0c895d2 add stub for the API test 2017-06-13 09:15:44 -07:00
John Safranek efeb9a41b2 rename directory test as tests 2017-06-13 09:05:57 -07:00