Zephyr 3.5 moved the RAM disk driver from Kconfig to devicetree and 4.1
replaced CONFIG_NET_SOCKETS_POSIX_NAMES with CONFIG_POSIX_API. Port the
sample to the new APIs while keeping it buildable on older Zephyr.
- add ramdisk.overlay (zephyr,ram-disk node) for the FS scenarios;
drop CONFIG_DISK_RAM_VOLUME_SIZE
- switch to CONFIG_POSIX_API; include the POSIX time/select/socket/netdb
headers in test.h and port.h, gated on ZEPHYR_VERSION_CODE >= 4.1.0 so
older Zephyr keeps the BSD names from <zephyr/net/socket.h>
- select RAM disk (overlay >= 3.5, else CONFIG_DISK_RAM_VOLUME_SIZE) and
POSIX (CONFIG_POSIX_API >= 4.1, else the legacy symbols) in
CMakeLists.txt, with ramdisk_legacy.conf / posix_legacy.conf fallbacks
- tests, nofs and kbi scenarios pass on qemu_x86 with Zephyr 3.4.0
(SDK 0.16.1) and 4.4.0 (SDK 1.0.0)
Keyboard-interactive was unusable in builds with
WOLFSSH_KEYBOARD_INTERACTIVE but no WOLFSSH_TERM, in two ways.
- ClientFreeBuffers declared 'entry' under TERM && KBI but used it
under KBI alone, so KBI-without-TERM failed to compile; widen the
declaration guard to match the use
- ClientUserAuth's keyboard-interactive branch is guarded on
TERM && KBI, so without TERM a keyboard-interactive request fell
past every branch and returned the initial WOLFSSH_USERAUTH_SUCCESS
with no responses populated. There is no terminal to prompt on, so
answer WOLFSSH_USERAUTH_FAILURE instead of claiming success.
- Add test_DoChannelWindowAdjust_overflow via new
wolfSSH_TestDoChannelWindowAdjust wrapper.
- Seed non-zero peer window, feed bytesToAdd = UINT32_MAX,
assert WS_OVERFLOW_E with window unchanged.
- Feed a fitting value, assert window advances.
- Covers the guard so flipping or deleting it now fails.
Issue: F-2874
- Add CipherSetKey()/CipherClear() to init, key, and free the Aes
contexts; init lazily and track isInit/cipherType.
- Free only inited contexts, fixing wc_AesFree on uninitialized ones.
- DoNewKeys now fails an unknown peer cipher with WS_INVALID_ALGO_ID
instead of WS_SUCCESS, matching SendNewKeys.
- Add regression coverage for isInit/cipherType and a never-keyed free.
- fail userauth when the request sets the password-change flag
- do not invoke the userauth callback with the current password
- parse the new-password field so the message is fully consumed
- add negative unit test asserting USERAUTH_FAILURE and no callback
Per RFC 4252 section 8, an expired password MUST NOT be used to
authenticate; password changes remain unsupported.
Issue: #1047 (6)
- enforce RFC 4253 section 6 minimum of 4 padding bytes on receive
- return WS_BUFFER_E when padding_length is below MIN_PAD_LENGTH
- add negative unit test driving DoReceive with a short-padded packet
Issue: #1047 (5)
- remove redundant useCurve25519MlKem HandshakeInfo flag
- merge the duplicate Curve25519 keygen branch in SendKexDhInit
- order the client KeyAgree dispatch to match the combined flags
- rename the surviving flags for clarity: useEcc->useEcdh and
useEccMlKem->useMlKem
- make the flag set orthogonal: each ML-KEM hybrid now sets its
classical-component flag (useEcdh or useCurve25519) alongside useMlKem,
so the four bits independently describe every KEX family
- apply the same flag handling to the server SendKexDhReply path
- ECDH and ECC+ML-KEM hybrid: validate the peer point through a shared
EccCheckPeerKey helper (import + wc_ecc_check_key) on client and server,
so the plain and hybrid paths cannot diverge
- add wolfSSH_TestKeyAgreeEcdh_server/client and wolfSSH_TestSetDhKexKey
test hooks
- add negative unit tests rejecting bad DH and off-curve ECDH peer keys on
client and server; the hybrid paths share the same helper and are
exercised by kex.test
Issues: F-5690, #1047 (1)
- DoKexInit skipped both language name-lists with an unchecked
begin += skipSz; a forged length could wrap begin into earlier
payload bytes and still return success.
- Use bounds-checked GetSkip for both language fields.
- Add regression test; checked skip now rejects with WS_BUFFER_E.
Issue: F-5576
- GetNameListRaw folded a trailing comma into the last name,
so NameToId returned ID_UNKNOWN and negotiation failed.
- Trim one trailing comma up front, matching AlgoListSz.
- Add regression test for a KEX list with a trailing comma.
Issue: F-2478
- forwarded-tcpip was never gated; fell through to default-accept channelOpenCb.
- Require fwdCb for both forwarding channel types, failing closed without it.
- Reject server-side forwarded-tcpip opens before any policy hook runs.
- Add regress coverage for both rejections.
Issue: F-6275
- Reply to a port-0 (dynamic) tcpip-forward with the bound port.
- Add WS_FWD_PORT_CHECK (1024) as the status/port boundary in WS_FwdCbError.
- Callback returns a WS_FwdCbError status below it, the port at or above it.
- DoGlobalRequestFwd reports the port and rejects a port-0 setup with none.
- Map a callback rejection to WS_RESOURCE_E so a no-reply request keeps the link.
- Update the echoserver reference callbacks (examples and Espressif) to
recover the OS-chosen port with getsockname() and return it under the new
convention.
- Add regress coverage for the allocated-port and rejection paths.
Issue: F-5573
Co-authored-by: John Safranek <john@wolfssl.com>
- Merge fileIdCount and dirIdCount into a single handleIdCount.
- File and directory handle IDs now share one namespace.
- A close or other handle op cannot match the wrong resource type.
- Track open SFTP file handles per session in a fileList, returning
opaque session-scoped handle IDs instead of raw file descriptors.
- Resolve and validate client-supplied handle IDs via FindFileHandle.
- Free the handle list and close handles on error paths, including the
Windows code paths.
- Drop the old raw-fd SFTP_ValidateFileHandle/STOREHANDLE handle table
and its tests, superseded by the per-session ID lookup.