macOS uses GCD for threading and semaphores, but they aren't quite like
POSIX semaphores. macOS allows the use of named POSIX semaphores.
1. Convert the semaphores to named POSIX semaphores.
2. Simplify all calls for semaphores into single function calls of the
wrapper API.
3. Update both examples/client/client.c and apps/wolfssh/wolfssh.c.
4. Update both to deregister the WINCH signal.
When filling the screen with spaces, the code was subtracting two
unsigned numbers and checking if they were negative. Changed to use a
comparison and adjust the subtraction as appropriate, then did the rest
of the size expansion. If the second point is before the first, set the
fill length to 0.
Affected function: wolfSSH_ClearScreen.
Issue: F-48
For agent ECC public key parsing, replaced parsing the data by hand with
the GetSkip() and GetStringRef() functions which do bounds checking.
Affected function: PrepareUserAuthRequestEcc.
Issue: F-526
Replace the original message parsing functions with the GetString()
function, which does better bounds checking.
Affected functions: DoServiceRequest, DoServiceAccept.
Issue: F-524, F-525
Replace the original message parsing functions with the GetStringRef()
function, which does better bounds checking.
Affected function: DoUserAuthRequestPassword.
Issue: F-411
The DoIgnore() function was not bounds checking the ignore message.
Changed it to use the GetSkip() function which does bounds checking and
skips the current blob. Updated GetSkip() to allow 0 length blobs to
skip.
Affected function: DoIgnore.
Issue: F-410
In wolfSSHd, the comparisons of the password hash and public keys were
using memcmp(). Changed to use ConstantCompare().
Affected functions: CheckPasswordHashUnix, CheckPublicKeyUnix.
Issue: F-53
1. Moved functions SFTP_CreatePacket(), wolfSSH_SFTP_SetDefaultPath(),
and SFTP_FreeHandles() to related functions, and their build guards.
2. Updated one of the OS-specific SFTP_GetAttributes() utility functions
as static.
3. Removed or moved some function prototypes.
4. Added a guard around function SFTP_FreeHandles() in the function
wolfSSH_SFTP_free(). The guard around the function call now matches
the guard around the prototype.
ZD #21261
1. Separate the key type and signature type when handling user
authentication. ssh-rsa is a key type used with rsa-sha2-256 and
rsa-sha2-512 signatures, along with ssh-rsa signatures.
2. Allow rsa-sha2-512 to be used.
3. Fix bug where setting the key algorithm on the client command line
was setting the list to NULL.
4. Fix bug where adding rsa-sha2-512 to the list of canned algorithms
was terminating the list, rather that adding it.
Issue: ZD-21247
1. When disabling mlkem768nistp256-sha256, there's a crash when doing a
mlkem768x25519-sha256 KEX. It tries to do a DH key exchange instead
of x25519 with ML-KEM. Modified the check.
2. Fixed a guard where the build was treating not having
mlkem768nistp256-sha256 like a FIPS build disallowing using ML-KEM
when generating sesssion keys. It shouldn't make that check.
3. Added a test case to the KEM test.
1. Adds --disable-server and --disable-client configure flags. Allows for
compile-time exclusion of server or client code.
2. Add check to internal.h for both NO_WOLFSSH_SERVER and
NO_WOLFSSH_CLIENT being set and errors.
3. In ports.h, add check for not-NO_WOLFSSH_CLIENT so SFTP/SCP
filesystrem types are also available in client-only builds.
4. Update the NO_WOLFSSH_SERVER and NO_WOLFSSH_DIR guards around
wolfsftp.c. Update wolfSSH_SFTP_free() to skip directory cleanup
when server code is disabled.
ZD #21261
Removed the variable. The flags passed to ff_open() are appropriate for
ff_open(). Just check that read or write is set.
Affected function: ff_open.
Issue: F-213
When a copy of the user's password is freed, it wasn't getting force
zeroed. It might still exist in the heap after getting freed. Added
a call to `ForceZero()`.
Affected function: CheckPasswordUnix.
Issue: F-56
Addded a break to the 'J' case of a switch statement that handles
terminal display clearing for Windows. It was flowing into case 'K'
without an explicit fallthrough tag.
Affected function: wolfSSH_DoControlSeq.
Issue: F-49
Check the return value of `wc_InitRsaKey()`. It will initialize the
structure provided the pointer is non-null. Since the key is on the
stack, the later call to `wc_FreeRsaKey()` will succeed as well.
Modified the check for the encoded signature size inside the block where
it is set; that check also updates the return value.
Affected function: SignHashRsa.
Issue: F-212
1. Call `wc_ecc_init()` on an ECC key before importing it.
2. Incidental: `PostLock()` and `PostUnlock()` needed their agent pointers
tagged as unused.
Affected functions: SignHashEcc. PostLock and PostUnlock.
Issue: F-211
1. When wolfSSH_worker() receives channel data, it should set the
channelId for the data. It was not happening. Change the check for
WS_SUCCESS to also check for WS_CHAN_RXD.
1. Add a test script and expect script for testing forwarding.
2. Update portfwd to have a ready file option.
3. Fix echoserver error string, needed NL.
1. Fix a couple unused variable warnings.
2. In wolfSSH_AGENT_DefaultActions(), fix comparison to the result of
snprintf() treating normal result as an error. Reset the return code
for the error state of the socket() command. Better cleanup of agent
startup failures.
Was using OR to check if a bit was set in the read-only file attribute.
This was always succeeding. Needed to change to an AND to see if it is
set.
Affected function: GetFileStats.
After creating a new SSH context, the pointer returned wasn't checked;
the pointer to the pointer was checked. Changed to the correct pointer.
Affected function: SetupCTX.