Commit Graph

46 Commits (b530d263577c295f3d1b1627e7fd54d4e1d148cd)

Author SHA1 Message Date
Chris Conlon 6a22968b87 enable compilation of example server by default 2018-05-31 13:45:54 -06:00
Chris Conlon f37c7224fb fix threading in example server 2018-05-31 13:45:53 -06:00
Chris Conlon c0cb237881 scanbuild: fix bufName dead assignment 2018-05-03 14:56:27 -06:00
Jacob Barthelmeh bb668fe743 use of buffer keys in examples with no filesystem 2018-03-30 10:45:24 -06: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 65fb16ddc4 Client
1. Added support to the library for clients.
2. Added example client.
3. Added VS solutions for building client example.
4. Added ECC client keys. Renamed existing keys.
5. Since defunct server is copy of echoserver, updated it.
2017-09-25 14:45:03 -07:00
John Safranek 7e08469794 IDE DLL Builds
1. Moved some of the files around.
2. Updated the readme.
3. Added a property file with a set of user macros to point at wolfSSL include and build directories.
4. Updated all the project files to use the new user macros.
5. Add guard around including options.h in the echoserver.
2017-09-15 16:46:14 -07:00
John Safranek e471635373 IDE
1. Added DLL builds.
2. Cleaned up some of the build configuration.
3. Updated the README files for building.
4. Renamed the function ProcessBuffer() with a prefix due to a conflicting name with wolfSSL.
5. Added test.h to include.am.
6. Moved the user_settings.h for wolfSSL into the wolfcrypt directory.
7. Changed the echoserver so that it binds to INADDR_ANY.
2017-09-13 15:33:23 -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 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
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 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
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 184b2218d4 Rekeying Update
1. Add the Trigger Rekeying function.
2. Fixing the keying state machine.
3. Modify echoserver for rekeying.
2016-10-21 13:40:35 -07:00
John Safranek da4b19524d RSA Private Key Generation Wrapper Function
1. Implemented the RSA key generation wrapper function.
2. Rearrange the unit test code.
3. Added RSA key generation wrapper function to unit test.
4. Removed certificate load from echoserver.
5. Not using certificates, removed the functions and storage.
6. Removed unused certificate files.
7. Renamed certs directory as keys.
8. Removed the example server from the build for now.
9. Created new server key with the RSA key generation function.
10. Add IDs for public keys for keygen use.
11. Whitespace cleanup.
2016-10-13 10:02:03 -07:00
JacobBarthelmeh 7952fdf035 Merge pull request #17 from ejohnstown/highwater
Transfer Highwater Mark, Session Key Refactoring
2016-10-05 17:07:10 -06:00
John Safranek 569890067a Added a transfer highwater callback to the echoserver that
prints that the highwater mark was hit and doubles the
highwater mark value. It is disabled by default. To use,
when configuring add the CPPFLAG "DEFAULT_HIGHWATER_MARK".
For example, `CPPFLAGS=-DDEFAULT_HIGHWATER_MARK=128`
2016-10-05 14:56:21 -07:00
John Safranek b0d318fce0 wolfCrypt Update
Include wolfSSL's options.h to echoserver.c. When building wolfSSL
with AES-NI and wolfSSH in debug, the ALIGN16 on the SHA-256
structure is lost in wolfSSH, where the wolfCrypt code is expecting
the parameters to be ALIGN16.
2016-10-05 12:14:05 -07:00
John Safranek c71f4e8948 tweaked the err_sys to follow the updated wolfSSL version 2016-08-27 14:08:53 -07:00
John Safranek 629cb8d160 Copied change to err_sys() from wolfSSL. Cleaned up a static analysis
issue. Also added the attribute noreturn to the function since it
doesn't actually return.
2016-08-25 13:15:24 -07:00
John Safranek 1a278fe713 update copyright dates and licensing to GPLv3 2016-07-19 13:44:02 -07:00
John Safranek 525a8858c5 Add return code when the peer window is too small on a send. Echoserver wasn't properly checking the return code on the stream receive. 2016-07-14 14:47:30 -07:00
John Safranek d101f1d537 fix a few stray memory leaks 2016-07-14 12:58:37 -07:00
John Safranek 4dc3c56a88 fixing RSA public key user auth, failover to password 2016-07-13 15:11:33 -07:00
John Safranek ba8c512a77 1. Some files were missing from make dist.
2. Reorg examples/include.am.
3. Stop building example server for now, but keep the source.
2016-07-06 13:49:08 -07:00
John Safranek d3bfc61d44 remove unused assignment in echoserver 2016-06-22 15:41:33 -06:00
John Safranek 89d92bb886 refactor userauth 2016-06-17 14:23:20 -07:00
John Safranek a275ac59f0 1. Flushed out the authentication callback.
2. Added public key authentication.
2016-06-17 14:23:20 -07:00
dgarske 8e3e5a1bf5 Merge pull request #3 from ejohnstown/fixes1
Fixes1
2016-06-17 11:29:01 -07:00
John Safranek 24c606527a echoserver detects CTRL-C and closes the connection 2016-04-11 08:39:55 -07:00
John Safranek 0386a3c50f move shared inline functions to misc file. add configure option to disable inline functions. 2016-04-01 14:40:22 -07:00
John Safranek 2ce312400a example echoserver behaves like a crude echoserver 2015-01-14 15:04:47 -08:00
John Safranek e21e6fd0eb copy example server as echoserver 2015-01-14 12:21:26 -08:00
John Safranek f9fa42e244 1. added in the stream receive function
2. example uses the new receive function
2015-01-14 10:53:33 -08:00
John Safranek b548720a9a 1. added in the stream send function
2. example uses the new send function
3. added in window size update receipt
4. tweaked the accept state machine to actually finish
2015-01-07 13:49:01 -08:00
John Safranek 917c6a84c4 Clean up build warnings under Linux 2014-08-14 11:46:23 -07:00
John Safranek 7e2674c29a 1. Added test certificate and private key.
2. Added code to load single certificate and private key from buffers.
2014-08-15 14:20:42 -07:00
John Safranek f4b1908b17 Refactor the constants. 2014-08-15 11:37:00 -07:00
John Safranek 8cb5fea384 1. Added a description comment to each C and H file.
2. Updated the FSF address in the comments.
2014-08-11 16:19:11 -07:00
John Safranek bf052f42c9 Added an endpoint type, client or server, to the wolfSSH context
constructor. (For future use.)
2014-08-11 14:45:03 -07:00
John Safranek 1d2e1af069 filling in code 2014-07-28 07:12:54 -07:00
John Safranek dd897d2f6c example server attempts to accept an SSH connection. Note, the underlying code will lock up. 2014-07-14 11:09:50 -07:00
John Safranek f894548be5 Updated example server to use threads 2014-07-03 11:08:34 -07:00
John Safranek eb82d2bf28 Adding code 2014-07-01 17:27:47 -07:00
John Safranek 749cb6ff90 initial set of files 2014-06-24 14:48:08 -07:00