Commit Graph

60 Commits (8807fa0f2c1086f466c45eefa633165b1034404d)

Author SHA1 Message Date
John Safranek 8a010c168e
Merge pull request #81 from JacobBarthelmeh/testing
additional sftp and scp tests
2018-07-16 10:49:42 -07:00
Jacob Barthelmeh 73bcd5c95a external test script 2018-07-02 17:07:51 -06:00
Jacob Barthelmeh 2c4bca35e0 sftp test script added 2018-07-02 12:03:48 -06:00
Jacob Barthelmeh e47427c484 fix when reading directory
change from NO_WOLFSSL_DIR to NO_WOLFSSH_DIR

add chmod feature

changes for sftp port

file attributes and SFTP version

no exit on echoserver and revert scp
2018-06-29 09:19:40 -06:00
Jacob Barthelmeh 522d93add3 scp nucleus port
fix for uninitialised value

fix compile time warnings

scp only build and handle file size of 0

macro guard on sftp build

adjust directory pointer on desktop build

close connection still on fail and update derefrence of dir with nucleus

ssh only build for nucleus
2018-06-13 16:23:08 -06:00
Jacob Barthelmeh 6d434d0030 initial port to Nucleus
update example on Nucleus

add code sourcery IDE project

fix naming of IDE project files

clean up opendir for fail case

fix for build warnings

add fstat and fixes for nucleus port

update FALL_THROUGH case

add null terminator and more memory free's

fix for scan build warnings

fix warning of no return value

better bounds checking

better path cleaning

fix return values in header file

clean path before access

remove trailing delimiter from clean path
2018-06-13 09:44:54 -06:00
JacobBarthelmeh 0fc6f343b0
Merge pull request #72 from ejohnstown/static-fixes
fix a handful of clang static analysis warnings
2018-06-07 09:38:46 -06:00
John Safranek 8477c4acd6 fix a handful of clang static analysis warnings 2018-06-06 15:04:59 -07:00
Jacob Barthelmeh dfdb2b1335 change return value for SFTP connection and clean up after rebase 2018-06-01 17:22:06 -06:00
Jacob Barthelmeh 2b934bd941 update error values and fix [l]stat status packet 2018-06-01 17:20:54 -06:00
Jacob Barthelmeh 0194784e6d use XSTRNCMP and remove debug code used during devel 2018-06-01 17:20:54 -06:00
Jacob Barthelmeh b467a3073c able to establish SFTP connection and start of adding commands (still in devel, has debug print statements)
refactor sending SFTP packets

try to make internal function names more clear, add comments, and update sftp example

add parsing names and most of attributes

add SFTP debug tag

add mkdir with SFTP

start of framework for get

add get command and keep track of working directory

base case of put command

basic sftp rename command

basic sftp rm command

initial basic rmdir command added

initial basic reget/reput commands

clean up absolute path to working directory

move location of sftp client app and more testing

add more comments and make code more readable

cast on values and add exit

adjust macro names and test make dist

adjust gitignore and macro names

gcc-7 build

revert nameListIdx increment to find ssh-rsa

more comments

fix for possible use uninitialized warning

initial SFTP accept

send status packet and start of realpath

server side mkdir

initial process of stat and lstat packets

initial processing of rmdir packet

basics for server handling SFTP get command

initial commit for server handling basic put command

initial handling of receiving remove packet

initial server handling of rename packet

initial implementation of handling directory packets

better checking on return values

set correct return value on successful read

additional sanity checks on user inputs

make send and read packet API name more clear

cast for warning building with clang
2018-06-01 17:20:54 -06:00
Chris Conlon 8b6ac82158 update include.am files for scp 2018-05-31 13:45:54 -06:00
Chris Conlon 62d00eeaf9 update scp comments, cleanup 2018-05-31 13:45:54 -06:00
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