Commit Graph

308 Commits (37e3250164051622685516d43a3518623c80c86d)

Author SHA1 Message Date
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 60d945699a IDE
Add the echoserver to the project.
2017-08-31 13:25:03 -07:00
John Safranek faf3f45ed8 IDE
Updated the two projects with similar settings so they build without warnings. The wolfSSH library project needs the wolfSSL header path added before building. The api-test project needs the wolfSSL library added before building.
2017-08-31 11:26:24 -07:00
John Safranek a48a13e6ba IDE
1. Added a user_settings.h file to be used with building wolfSSL.
2. Removed misc.c from the wolfSSH library project.
3. Added the WOLFSSL_USER_SETTINGS define to the wolfSSH library project.
4. Replaced vsnprintf() and localtime_r() with macros to use the correct functions for Win32 builds.
5. Replaced the misc.c warning with the VS style of doing it if building for Win32.
6. Defined USE_WINDOWS_API if _WIN32 is set.

Note: The wolfSSH library builds in 32-bit Debug mode. To do so, you need to add the directory holding the wolfSSL headers to the AdditionalIncludeDirectories list.
2017-08-31 11:02:23 -07:00
John Safranek 6ac63009dc IDE
1. Adding the VisualStudio solution file.
2. Updated gitignore with the VS debris.
3. Adding project files for wolfssh library and apt-test.
2017-08-30 17:03:41 -07:00
John Safranek 05ee7b34c7 IDE
Add initial IDE build support with Windows VisualStudio. Just put in
the autoconf includes and a readme.
2017-07-21 14:25:38 -07:00
John Safranek 1d594eba1f ECC (#35)
* Renamed the server key files to indicate they are rsa keys.
* Add ecc key files for the server.
* Move ProcessBuffer from ssh.c to internal.c.
* Remove #includes for headers from files that are not used.
* Added support for KEX algorithms: ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521
* Updated readme
* Added support for the public key algorithm ecdsa-sha2-nistp256.
* Added support for public key algorithms ecdsa-sha2-nistp384 and ecdsa-sha2-nistp521.
* The Key Algorithm list for the KEX picks a single value to offer based on the private key used.
* Added private keys on curves nistp384 and nistp521. The curve nistp256 is used as the default.
* Added the new ecc keys to include.am
2017-07-14 12:24:38 -07:00
dgarske 4106ce3186 Merge pull request #34 from ejohnstown/aes-gcm
Add AES-GCM
2017-07-11 11:13:56 -07:00
John Safranek 686184d34d Update echoserver for an option to allow multiple connections
or single connections to ease memory testing.
2017-07-11 09:33:33 -07:00
John Safranek b86bb31cdd 1. Added in the code needed for AES-GCM.
2. Deleted the unused wolfSSH_worker() prototype.
2017-07-11 08:56:21 -07:00
John Safranek be57ef6b95 1. Bump the version numbers.
2. Remove some unused option strings and constants. They may be
   distracting.
2017-07-06 16:24:18 -07:00
dgarske 700a01f6f0 Merge pull request #33 from ejohnstown/release-v1.1.0
Update the configure script and readme for v1.1.0.
2017-06-15 08:25:54 -07:00
John Safranek afdbf2b7fe Update the configure script and readme for v1.1.0. 2017-06-15 08:08:20 -07:00
dgarske 770b90d0fd Merge pull request #32 from ejohnstown/unit-testing
Expanded Unit Testing
2017-06-14 18:08:48 -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
dgarske f3293dff87 Merge pull request #31 from ejohnstown/echoserver
Echoserver Enhancement
2017-06-12 16:41:15 -07:00
John Safranek 408ce5653d 1. Echoserver to catch Ctrl-E to provide session statistics.
2. Add wolfSSH_GetStats() to return session statistics.
3. Echoserver server_worker threads get a context with their
   wolfSSH session, an ID number, and socket fd.
2017-06-12 16:23:00 -07:00
John Safranek bcbf807fa0 Modify echoserver to have a stats key in addition to the
cancel session key.
2017-06-12 16:22:29 -07:00
dgarske ef1a92fe8b Merge pull request #30 from ejohnstown/gex
Add Group Exchange Support
2017-06-12 12:44:31 -07:00
John Safranek 26642bfa2c Remove the TEST_GEX build option. The DHGEX key agreement is the
first desired algo for the server.
2017-06-12 12:24:57 -07:00
John Safranek da126bfa48 Refactor the KEX init code to delay the start of calculating the KEX
hash until the KEXINIT from the client is received.
2017-06-12 12:24:57 -07:00
John Safranek 97e27cb7be DH-GEX
Filled out the message handling for the DH-GEX additional messages. To use
the DH-GEX, one needs to add the flag TEST_GEX. It is still a WIP. The
handshake state machine needs a change and the start of the hash calculation
needs to wait until receiving the client's KEX INIT message and the hash
type for the handshake signature can be resolved.
2017-06-12 12:24:57 -07:00
John Safranek 1a81d66f78 Framing in DH-GEX. 2017-06-12 12:24:57 -07:00
John Safranek 4319cb069c Unified Hashing
1. Added support for the wc_Hash wrappers. Need to keep track of the
   hash being used.
2. Assumed SHA1 only, and modified everything to use the hash wrappers.
2017-06-12 12:24:57 -07:00
John Safranek fcf0e5c55d SHA-256 Hash Support
1. Expanded GenerateKey() to obey the hash type.
2. Added cases for SHA-256 to the KDF test.
2017-06-12 12:24:57 -07:00
dgarske a35ed26e2c Merge pull request #29 from ejohnstown/client-rekey
Fix bug where client initiated rekeying failed
2017-06-12 12:14:12 -07:00
John Safranek 3cb286b600 Fix bug where client initiated rekeying failed. 2017-06-12 11:58:39 -07:00
dgarske 687d13a349 Merge pull request #28 from ejohnstown/string-clean
Update a few debugging strings were copied and pasted.
2017-06-12 11:17:38 -07:00
dgarske 7eb1dad6ef Merge pull request #27 from ejohnstown/fix-getstring
Fix GetString
2017-06-12 11:17:17 -07:00
dgarske a0d40e0cd1 Merge pull request #26 from ejohnstown/banner-config
Update the banner
2017-06-12 11:16:11 -07:00
dgarske 5ae31ea0c7 Merge pull request #25 from ejohnstown/global-request
Global Request Message
2017-06-12 11:15:11 -07:00
John Safranek 95a435055f Update a few debugging strings were copied and pasted. 2017-06-12 10:17:54 -07:00
John Safranek 711a52e4ce Adding the macOS DS_Store filename to the gitignore. 2017-05-30 16:16:16 -07:00
John Safranek ff14fbaef8 In GetString() added a check for the size of the destination buffer. 2017-05-30 14:38:15 -07:00
John Safranek a4285571f4 Update the banner
1. Add the banner to the WOLFSSH_CTX.
2. Moved the canned banner to be a debug option.
3. Default the banner to NULL of zero length.
4. Use the banner stored in the WOLFSSH_CTX.
5. Add an accessor to set the banner to a C string.
2017-05-30 14:25:41 -07:00
John Safranek 3d79d4ffa3 Global Request Message
1. Added parsing of the Global Request message. Will log the request
   name string.
2. Send global request failure response if reply is requested.
(This was an issue with a particular SSH client.)
2016-11-11 12:00:22 -08:00
toddouska 87eb3ad26d Merge pull request #24 from ejohnstown/chan-success
Channel Success Message
2016-10-25 14:45:45 -07:00
John Safranek c2480eb46c Add function to send Channel Success and Failure to the client when
receiving Channel Request messages, when requested.
2016-10-25 14:14:05 -07:00
toddouska ad80b4b613 Merge pull request #23 from ejohnstown/wc-fix
wolfCrypt Fix
2016-10-25 12:19:30 -07:00
John Safranek 6af24baf38 Fixed a missed set of wolfCrypt functions whose return values weren't getting checked. 2016-10-24 15:24:04 -07:00
toddouska a612d6cafe Merge pull request #22 from ejohnstown/rekeying
Rekeying
2016-10-24 15:19:05 -07:00
John Safranek 4ff6a525b6 Update README with the change of name of the keys directory. 2016-10-24 15:10:22 -07:00
John Safranek b76f376381 scan-build fix. clear a whole buffer before filling it before checking
with ConstantCompare().
2016-10-24 15:08:58 -07:00
John Safranek c802b331bd Check all return codes on wolfCrypt functions. 2016-10-24 15:03:54 -07:00
John Safranek c183000b93 1. Manage case where Client KEX Init arrives in same recv() as the
client version string.
2. Shrink the receive buffer after reading the client version
   string.
3. Resize the buffer correctly when needed data is already in the input
   buffer and grab the remainder as expected.
2016-10-24 13:42:58 -07:00
John Safranek 718a4f4b40 cleanup accept state machine 2016-10-24 11:51:42 -07:00
John Safranek ccc1101612 Fix where the result of sending a channel close was getting replaced
with success.
2016-10-23 16:14:17 -07:00