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.
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.
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().
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.
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.
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.
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.