Commit Graph

136 Commits (700a01f6f0f357af25f4cfe2ba3d101ce673ef49)

Author SHA1 Message Date
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 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
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
John Safranek 95a435055f Update a few debugging strings were copied and pasted. 2017-06-12 10:17:54 -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
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
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
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
John Safranek bc9eff91d6 1. Rename function ProcessReply(), conflicts when linking against
wolfSSL not using cryptonly mode.
2. Send server version before expecting client version.
2016-10-23 15:43:08 -07:00
John Safranek 5b07c8cb1d 1. Parse the Channel EOF message.
2. Parse the Channel Close message, and reply with a Channel Close.
2016-10-23 14:46:34 -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 41ec11e6ab Rekeying Update
1. Flushing out the keying state machine, taking it out of the accept
   state machine.
2. Changed the HandshakeInfo record to be something that can be
   recreated post-initial connection for rekeying.
3. Fixed the name of a previously unused size variable.
4. Moved some constants around.
2016-10-16 20:25:24 -07:00
John Safranek c564550999 Automatic Session Rekeying
1. Add stub rekey trigger function.
2. Add new default highwater callback that calls the rekey trigger
   function.
3. Rename the highwater level as "mark" rather than "count".
4. Add a flag to call the highwater callback once, cleared when the
   txCount is cleared when sending new keys message to peer.
5. Add new state machine for key exchange.
6. Start massaging the accept state machine for new KEX machine.
7. Update some default sizes, and replace magic numbers with named
   constants.
8. Scale back the accept state machine to add in the KEX state
   machine.
9. Capture the client version string and the server's KEX init message
   for rekeying.
10. Add compiler flag to allow "none" as a user auth method.
2016-10-16 15:16:24 -07:00
John Safranek b3ee5cd381 Send channel window adjust update when the receive buffer
has processed at least half of its available space. By
default, the receive window is 1MB, and the window size is
increased every 512kB.
2016-10-16 12:11:50 -07:00
John Safranek 919ed1f944 Optionally compile keygen.c. 2016-10-14 13:16:07 -07:00
John Safranek b6cda842e8 add function to notify peer of window size adjustment 2016-10-14 12:45:09 -07:00
John Safranek d9808cec31 tweak the peerWindowSz updating and logging 2016-10-14 12:45:09 -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
John Safranek 04e361a558 1. fix scan-build warning on ConstantCompare
2. fix visibility label typos
2016-10-07 10:04:04 -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 2cf5ad63ac wolfCrypt
1. Add call to wolfCrypt_Init() to wolfSSH_Init().
2. Modify have_wolfssl.m4 to check for wolfCrypt, not wolfSSL.
2016-10-05 10:55:30 -07:00
John Safranek 6561da9ce2 Updates to the data highwater marks for a callback. 2016-10-04 09:55:09 -07:00
John Safranek 7c8801409c Move the WOLFSSH and WOLFSSH_CTX initializer and free functions from
ssh.c to internal.c.
2016-10-04 09:55:09 -07:00
John Safranek 73e4e58795 1. Regroup the session keys into a separate structure.
2. Separate sets of keys for client and server.
3. Store generated keys in handshake info record.
4. Copy session keys over when sending and receiving the
   New Keys message.
2016-10-04 09:55:09 -07:00
John Safranek 30c4a32611 1. Add accessors for session data high water mark.
2. Check transmit and receive against high water mark and log.
2016-10-04 09:55:09 -07:00
John Safranek 2c3d78b4a6 Change misc.c error to warning and exclude the misc.c code from being compiled. Most people include all .c files and by default inlining is allowed, which in turn causes an #error in misc.c and it must be excluded. Since we know its already been properly included there is no reason to throw error here. Instead, show warning and exclude code in .c file.
Copied from wolfSSL pull request #521.
2016-08-09 10:44:33 -07:00
JacobBarthelmeh 1039cb9d43 Merge pull request #13 from ejohnstown/more-cleanup
More Cleanup
2016-07-22 10:31:34 -06:00
John Safranek c8da16cbe8 use the proper memcpy alias for wolfSSH 2016-07-22 09:30:02 -07:00
John Safranek 2e1744265b more return code checking 2016-07-21 20:07:29 -07:00
John Safranek f865ad2487 move the primitive data decoders, use them more 2016-07-20 19:57:54 -07:00
John Safranek 1a278fe713 update copyright dates and licensing to GPLv3 2016-07-19 13:44:02 -07:00
John Safranek bebe452d12 removed goto from processing the public key authentication 2016-07-19 11:03:37 -07:00
John Safranek 4041ecf408 Updated many functions with better error checking. 2016-07-18 21:21:42 -07:00
John Safranek 1e77d1595b 1. Sending data to a channel needs to use the peer channel ID.
2. Added a default peer channel ID for transmits.
3. Refactor the SendChannelData and SendChannelOpenConf functions.
2016-07-18 14:19:20 -07:00
John Safranek 79c8a503c4 1. Added some more return code checking and returning.
2. Look up channels in the channel list when processing
channel based messages rather than assuming the first
channel in the list.
2016-07-15 14:51:09 -07:00
John Safranek 1389df80bc initial multi-channel support 2016-07-14 22:46:06 -07:00