Commit Graph

1522 Commits (049e40bb1c5c20ff9bc335ffba07aa44c92735a2)

Author SHA1 Message Date
JacobBarthelmeh 049e40bb1c better handling of window full cases with SFTP 2023-06-26 22:58:28 -07:00
David Garske b17f73a585
Merge pull request #525 from ejohnstown/even-more-rsa-userauth
RFC 8332: Part 2
2023-06-23 09:55:28 -07:00
John Safranek a4e194ba96
RFC 8332 (user auth updates)
1. Rename one of the new constants.
2. Change a couple new string values to be file-static.
3. Add word32 typecasts to all the sizeof() uses in internal.c where
   they are assigned to or used with word32 values. (Some compilers
   complain about the implicit typecasting to values of smaller size.)
2023-06-22 22:33:38 -07:00
John Safranek 2dcb010d05
RFC 8332 (user auth updates)
1. Add logging of the signature type used in both server authentication
   and user authentication.
2. Fix issue with the user authentication request message using the key
   type rather than the signature type in the message.
2023-06-21 19:37:48 -07:00
David Garske 42cc83f5dd
Merge pull request #528 from ejohnstown/grow-fix
Buffer Grow Fix
2023-06-20 10:16:08 -07:00
John Safranek 6a3e4856b4
I/O Buffer Refactor
1. Started changing LENGTH_SZ to UINT32_SZ. The RFCs define the length
   of strings and mpints as uint32 values.
2. Some whitespace changes.
3. The getting data into the input buffer is done based on the goal size.
   The pattern is to get the first block, decrypt it if necessary, then read
   the size out, then get that much data plus the size of the length and the
   MAC.
2023-06-15 13:25:33 -07:00
John Safranek 68f026dc00
I/O Buffer Refactor
1. Change LENGTH_SZ to be UINT32_SZ.
2. Change the buffer's length to be the insert point for adding data,
   and the idx is where is it removed.
3. Changed the buffer's available size to be the length minus the idx.
4. Updated the copy behavior of GrowBuffer() and ShrinkBuffer().
2023-06-15 13:03:44 -07:00
John Safranek 67f7db23a3
I/O Buffer Refactor
Fuzzing found an issue with the I/O buffer handling. This refactor
simplifies the handling inside the existing functions.
2023-06-13 21:31:43 -07:00
John Safranek 522401e196
Whitespace and Distraction Cleanup
1. Cleaned up some whitespace.
2. A couple functions were using a couple strings repeatedly. Assigned
   to a pointer and used that instead. Also used strlen rather then
   sizeof for them.
2023-06-12 09:55:01 -07:00
JacobBarthelmeh 15cc7c491d
Merge pull request #526 from ejohnstown/mac-build
Mac Build Fix
2023-06-08 09:25:52 -06:00
John Safranek 8b4ae3681c
Mac Build Fix
Put macro wrapper around function getgrouplist(). The mac is treating it
as taking a pointer to int rather than gid_t.
2023-06-07 17:33:32 -07:00
John Safranek 83aa2650c2
Merge pull request #463 from danielinux/improve-fatfs-support
Support for FATFS on Xilinx targets
2023-06-07 11:13:56 -07:00
Daniele Lacamera ea854c8b0f Added option WOLFSSH_XILFATFS 2023-06-07 18:08:53 +02:00
Daniele Lacamera 35fc7dd4e8 Improve FATFS: correct lifetime on ff_open/close 2023-06-06 11:48:54 +02:00
John Safranek 9afc6a3cc0
RFC 8332 (user auth updates)
1. Pick the algorithm based on the server's user auth algo list for
   SHA2 signing.
2. When PrepareUserAuthRequest is called based on keySigId, do it
   conditionally on error.
2023-06-02 15:05:43 -07:00
John Safranek 169d2c6bb5 RFC 8332 (user auth updates)
1. Add sending and decoding the RFC 8308 extensions, specifically the
   server signature algorithms extension.
2. Add function CountNameList() to count items in a name list.
3. Split GetNameList() to make GetNameListRaw() that is given the
   pointer to the start of the list and its size.
4. Store the list of server user auth algos in the WOLFSSH object.
2023-06-02 14:43:15 -07:00
John Safranek 9d1996ae20 RFC 8332: User Authentication
1. Updating DoUserAuthPublicKey parsing.
2. Add the RFC 8308 extension support to indicate user authentication
   public key types.
2023-06-02 13:57:00 -07:00
JacobBarthelmeh 77e28cf324
Merge pull request #517 from ejohnstown/even-more-rsa-serverauth
RFC 8332: Part 1
2023-06-02 11:14:25 -06:00
John Safranek 639f896320
Merge pull request #519 from JacobBarthelmeh/scp
break between SSH accept and SCP operation
2023-06-01 20:54:43 -07:00
John Safranek db443df99b
RFC 8332 (server auth updates)
1. Increased the number of private keys stored.
2. Increased the number of items processed in the received KexInit
   message. Other SSH implementations are sending many more possible
   algorithm selections.
3. Split the adding of private keys and certificates to a WOLFSSH_CTX
   into two functions. Both share an action to make sure certificates
   and keys are married up as appropriate.
4. Removed the function UpdateKeyID() as it was modifying the
   WOLFSSH_CTX after having created WOLFSSH objects with it. Its other
   behaviors were incorporated into 3 above.
2023-06-01 20:49:06 -07:00
John Safranek 826a045bf4 RFC 8332
1. Add server auth support for RSA signing with SHA2-256 and SHA2-512.
2023-06-01 16:10:45 -07:00
JacobBarthelmeh 981a506967 add check for channel eof and remove shutdown call 2023-06-01 15:05:24 -07:00
John Safranek f41135dbd9
Merge pull request #520 from JacobBarthelmeh/auth
fix empty password support regression
2023-06-01 11:17:55 -07:00
John Safranek 1f531265f8
Merge pull request #523 from JacobBarthelmeh/groups
fix for setting secondary groups
2023-06-01 10:59:08 -07:00
JacobBarthelmeh 066aa22259 fix for setting secondary groups 2023-05-26 07:56:24 -07:00
John Safranek 6fabf0084c
Merge pull request #521 from JacobBarthelmeh/qnx
keep raised permissions for startup
2023-05-24 14:59:47 -07:00
John Safranek d349d15192
Merge pull request #522 from JacobBarthelmeh/shell
add cr for enter with shell connections to windows server
2023-05-24 14:58:48 -07:00
JacobBarthelmeh f18f9adf1f fix for check on empty password 2023-05-24 14:53:50 -07:00
John Safranek 92fcefa870
Merge pull request #515 from JacobBarthelmeh/sshd
add secondary groups as well
2023-05-24 11:31:00 -07:00
JacobBarthelmeh 796a745a92 fix scan-build warning for check on ret value 2023-05-19 13:49:23 -07:00
JacobBarthelmeh 3da8e2a690 add cr for enter with shell connections to windows server 2023-05-19 12:59:04 -07:00
JacobBarthelmeh ebbf43d2fe catch SCP as exec session 2023-05-19 10:55:07 -07:00
JacobBarthelmeh 26b68c2b1b keep raised permissions for startup 2023-05-19 09:50:23 -07:00
JacobBarthelmeh 94df77ff76 fix empty password support regression 2023-05-19 06:58:23 -07:00
JacobBarthelmeh 3f2aa055ab break between SSH accept and SCP operation 2023-05-19 06:26:18 -07:00
JacobBarthelmeh 7fa4f4a794
Merge pull request #516 from ejohnstown/kex-reply-scope
Variable Scoping
2023-05-11 22:09:27 -06:00
John Safranek 851ac5525e
Variable Scope
1. Tighten up scope on variables in function SendKexDhReply.
2. Fix echoserver not handling the non-blocking would block state for
   SFTP.
2023-05-11 11:10:44 -07:00
JacobBarthelmeh 7b3563a4b6
Merge pull request #510 from anhu/ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org
ecc_p256-kyber_level1 interop with OQS OpenSSH
2023-05-05 16:37:32 -06:00
JacobBarthelmeh b11e87b384 add secondary groups as well 2023-05-05 15:20:27 -07:00
Anthony Hu 9b96f58442 ecc_p256-kyber_level interop with OQS OpenSSH
The implementation now complies with the following draft:
https://www.ietf.org/id/draft-kampanakis-curdle-ssh-pq-ke-01.html

We implement the method as defined by the following name:
ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org
2023-05-05 15:01:07 -04:00
David Garske e0b641bafc
Merge pull request #513 from lealem47/packDocs
Document Cube Pack dependencies
2023-05-04 11:29:11 -07:00
Lealem Amedie 66e19b74d4 Document Cube Pack dependencies 2023-05-03 14:56:52 -06:00
JacobBarthelmeh 54df2e99b8
Merge pull request #509 from ejohnstown/sftp-update
Updates for SFTP Support
2023-04-24 16:27:52 -06:00
John Safranek d00db44b2f
SFTP Update
1. In the API test for SFTP, change the amount of the file requested to
   the limit WOLFSSH_MAX_SFTP_RW.
2. The check for want read on the exit of the server worker should clear
   ret if it is want read.
2023-04-19 13:39:35 -07:00
John Safranek 748f085f12
Rekey
1. Fix an issue found in testing. Some checks for rekeying might happen
   when ssh is NULL.
2023-04-13 16:43:05 -07:00
John Safranek 35554745bc
Update sftpclient
1. Update the example SFTP client with changes made for the echoserver.
2. Better handling of rekeying status.
2023-04-13 16:17:59 -07:00
John Safranek 7e7c5553df
Update wolfSSHd
1. Update wolfSSHd with changes made for the echoserver.
2. Better indication of when the SFTP channel closes.
2023-04-13 11:52:22 -07:00
John Safranek c97e8ea319
Rekey
With the previous change for speed and timing, rekeying started having
trouble in SFTP. Each file block travels as two messages, and the
rekeying starts, but the messages are sent and lost. The client would
terminate the connection.

1. Tweak the timeout in the echoserver's SFTP loop.
2. Better checking for rekeying.
3. Returning that rekeying is happening.
2023-04-11 19:50:55 -07:00
John Safranek 73946a36c6
Decoupling SFTP from SSH
wolfSSH has a reach too deep into the wolfSSH internals. SFTP should
be more like an application running on top of wolfSSH. We prefer to
keep it all in one application, so it will work well in an embedded
environment, but there needs more separation.

1. The sftp_worker loop in the echoserver should prioritize reading
   the socket and processing the SSH layer messages. Next it should
   ensure the transmit buffer for the SFTP channel is being written.
   Last it should check the receive buffer for the SFTP for new
   messages from the peer. wolfSSH_worker() will ensure data is read
   from the socket, and distributed to the appropriate channel
   receieve buffers, and will make sure the SSH bookkeeping is
   performed.
2. SendChannelData() should also bound the send data amount by the
   local maxPacketSz.
3. wolfSSH_SFTP_buffer_send() should send only one chunk of data, not
   looping until everything is gone. Need to send, but cannot flood
   the output.
4. Remove the call to wolfSSH_worker() from the buffer send.
5. The wolfSSH_SFTP_read() state machine should check the return
   status from the call to buffer send, and if it isn't an error,
   don't clear the state, allow for a want-write write again later.
6. Do not limit the file chunk size to send to WOLFSSH_MAX_SFTP_RW.
   This limit is provided during SFTP negotiation. If the peer
   requests that much data, send it.
6. Modify the select wrapper to have a very small microseconds value
   in addition to the requested seconds.
2023-04-10 15:57:25 -07:00
John Safranek 3f6c6f6964
Merge pull request #506 from JacobBarthelmeh/scp
refactor client apps and add X509 to scpclient
2023-04-05 14:14:17 -07:00