Commit Graph

402 Commits (e590ee3445ff8f699806b8c4e99e353f5375fa4b)

Author SHA1 Message Date
Jacob Barthelmeh da3135f345 fix comments and add in more 2019-08-16 10:16:25 -06:00
John Safranek 03f77d1de5
Merge pull request #182 from JacobBarthelmeh/auth
add back in password auth
2019-08-05 08:36:43 -07:00
Jacob Barthelmeh 318c6429fb add back in password auth 2019-07-24 09:21:44 -06:00
Jacob Barthelmeh 72a5f75ccd fix check on want write state with SFTP 2019-07-05 10:47:45 -06:00
Andrew Hutchings 76654e7530 More NULL ptr dereference fixes
Found using cppcheck. Also fixed debug logging getting missed from my
previous PR.
2019-07-03 13:47:52 +01:00
JacobBarthelmeh 1e57763f5e
Merge pull request #173 from LinuxJedi/minor-fixes
Fix possible NULL ptr dereferences
2019-07-02 10:21:02 -06:00
John Safranek ff6c167aad
Merge pull request #175 from kojo1/PW_retry
Password retry out
2019-07-01 16:46:42 -07:00
Takashi Kojo 401fcbd483 Fix WS_LAST_E 2019-07-02 08:15:28 +09:00
Takashi Kojo 3e58768b7e WS_USER_AUTH_E for wolfSSH_get_error 2019-06-29 13:02:21 +09:00
Takashi Kojo 58a768df29 WOLFSSH_USERAUTH_REJECTED 2019-06-29 12:37:34 +09:00
Takashi Kojo 153fa4798b WS_PASSWORD_RETRYOUT 2019-06-29 12:11:51 +09:00
Takashi Kojo 650bdf40b4 Pasword retry out 2019-06-26 13:27:14 +09:00
Jacob Barthelmeh 2279183e3a fix for setting rPad/sPad value 2019-06-24 10:22:02 -06:00
Andrew Hutchings f07fd5b002 Fix possible NULL ptr dereferences
If certain variables are set to NULL a WS_BAD_ARGUMENT is set but there
is no return until the end of the function. In both the cases in this
commit the NULL ptr could be dereferenced after the ret has been set.
2019-06-24 09:02:22 +01:00
John Safranek 62f309c8ae
Merge pull request #170 from kojo1/GlobalReq
Global request
2019-06-18 10:18:46 -07:00
Takashi Kojo 526ff95de2 move wolfSSH_SetReqSuccess to ssh.c 2019-06-17 05:51:38 +09:00
John Safranek 3db449d736 Public key authentication
1. Remove a forced test value for a sigSz in PrepareUserAuthRequestEcc.
2. When building the PrepareUserAuthRequest message for ECC user public
keys, the temporary buffer for the signature should be the size of a
signature for prime256 signatures, not 512 bytes.
2019-06-07 16:05:10 -07:00
John Safranek 56616d3416 Public key authentication
1. Cleanup some debug printouts.
2. Add option to the echoserver and wolfSFTP client to use ECC keys or RSA
keys for user authentication.
3. Add option to the echoserver to use ECC keys for peer authentication.

Note, the user authentication type is still hardcoded in the library as
password. To use public key, need to update the authId in
SendUserAuthFailure().
2019-06-06 11:59:35 -07:00
John Safranek d755132ccf Public key authentication
1. Refactor of the RSA public key and password user auth code.
2. In the userauth code remove some usused variable names or use some orphaned variables.
3. Fix the sizes used for calculating the buffer size for ECC public keys.
4. Add in the length of the ECDSA signature wrapping the set r,s.
5. Return the public key rejected error code from DoUserAuthRequestPublicKey when the callback returns invalid public key.
2019-06-06 10:37:22 -07:00
Takashi Kojo faa9764753 add Global Request callback 2019-06-06 07:10:44 +09:00
Takashi Kojo 53aa61580e Minor fix 2019-06-06 07:10:44 +09:00
Takashi Kojo 86cbb26868 Add send Global Request 2019-06-06 07:10:44 +09:00
John Safranek 46d97d751c Refactor Packet Assembly
1. PreparePacket() is to be given an estimated payloadSz, not the actual
payloadSz. The payloadSz should be larger or equal to the actual.
2. BuildPacket() calculates the actual payloadSz based on the position
of idx and value of idx stored before PreparePacket() returns. The size
of the padding is also calculated at this point.

Currently, everything going into a packet needs to be calculated ahead
of time and saved locally until the output buffer is prepared. This
requires saving RSA and ECDSA signatures in large buffers to be copied
later. Now such things can be calculated directly into the output buffer
without the temporary storage and copy.
2019-06-05 14:20:56 -07: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 2547a213e3 Receive Window
1. Fix bug when setting the receive window to 2048 bytes and the LS
would fail. The OpenSSH server is splitting a single full names message
across mulitple SSH data records. Needed to treat partial reads at the
LS level as a would-block.
2019-05-09 15:06:50 -07:00
John Safranek 150ad93a07 Memory Refactor
1. Add functions to print out the sizes of various structures.
2019-05-09 09:37:29 -07:00
Hideki Miyazaki d98acb8d35 addressed review comments 2019-05-07 09:50:26 +09:00
Hideki Miyazaki c402947e3e Add Renesas CS+ support and example server
Fixed CC-RX compiler warning

Fixed README
2019-05-07 09:20:15 +09:00
Jacob Barthelmeh 3c0e45db59 match lwip errno include from wolfSSL 2019-04-30 13:02:08 -06:00
Jacob Barthelmeh cfe2aafbf0 static analysis and cast of argument 2019-04-30 13:02:08 -06:00
Jacob Barthelmeh fbbd3aa552 fixes for infer test 2019-04-30 13:02:08 -06:00
John Safranek 4ce4b72e1c
Merge pull request #160 from JacobBarthelmeh/testing
fix for gcc 8 build warnings
2019-04-30 08:59:56 -07:00
John Safranek cd05289772 Auth Fix
Before calling the auth callback, be sure to zero out the UserAuthData
I/O value, in case the calling application doesn't set a password or
key.
2019-04-26 10:21:14 -07:00
John Safranek 63423e7431 fd Fix
1. Resolved a missed use of the socket FD where it was still being treated as an int.
2. Cleaned up some whitespace in io.c.
2019-04-26 09:29:59 -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
Jacob Barthelmeh 1fd4c2cc0c fix for gcc 8 build warnings 2019-04-25 11:32:05 -06:00
Jacob Barthelmeh 3b722bf662 maintain Nucleus port 2019-04-08 13:22:36 -06:00
John Safranek 9aaebbb146 Update the copyright to 2019 2019-04-08 10:24:08 -07:00
John Safranek f7f7b4743e
Merge pull request #147 from kojo1/add-algos
Add AES-CTR, make Algo configurable
2019-04-05 14:14:03 -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
Takashi Kojo 658f081237 make configuration opts, WOLFSSH_NO_xxx, compatible with wolfSSL names. 2019-04-05 08:39:10 +09:00
Takashi Kojo a93bc3673e guard by configuration options, WOLFSSH_NO_xxx 2019-04-05 06:52:54 +09:00
John Safranek 883b29d031 Memory Update
1. Removed the memory API.
2. Wired the existing memory calls back into the wolfCrypt memory calls.
3. Updated the include.am and vcxproj files for the deleted source.

The wolfSSH memory API is a shallow copy of the wolfCrypt memory API.
wolfCrypt's API offers more options including logging and static memory
that may be useful for wolfSSH in the future. Since both APIs were
available, wolfSSH's was removed as redundant.
2019-04-04 11:19:09 -07:00
John Safranek b7c4630b01 Memory Update
1. Fixed a couple of dynamic memory type identifiers with typos.
2. Fixed a reference to the heap in a free.
These were missed by the compiler becuase in generic builds, the heap
and dynamic type are ignored in a macro.
2019-04-04 10:24:53 -07:00
Takashi Kojo 08faaf9f46 configurable cannedXXXAlgoNames 2019-04-04 17:12:38 +09:00
John Safranek d3f3e2ca33
Merge pull request #119 from JacobBarthelmeh/exec
Extended Data Read and Execute Channel
2019-04-03 16:21:47 -07:00
John Safranek 0326cfea31 Fuzz Fix
AFL found a failed bounds check in DoDebug. Fixed the check to test for the smallest possible size of the incoming message.
2019-04-03 14:09:06 -07:00
John Safranek 47a51b5a5b Server Public Key Bug Fix
The callback was getting a pointer to the raw public key data in the
receive buffer including the blob length, this caused the pubkey to be
short in the callback. Updated the pubKey given to the callback to be
the SSH encoded blob without the total size, and pass the total size in.
Also, update the hash of the public key to include the size.
2019-04-03 10:18:20 -07:00
Takashi Kojo 357172afcd add CTR in cannedEncAlgoNames 2019-04-03 09:46:31 +09:00
Takashi Kojo b8a2101499 AES_ENCRYPT for AES-CTR, wc_AesSetKey 2019-04-03 06:47:47 +09:00