- 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>
- 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.
Run the DoUserAuthRequestRsa vectors through the X.509 path to pin
that a raw signature with a high leading bit is accepted via the
RFC 6187 branch. keys/ has no RSA certificate, so the test embeds a
self-signed cert made from keys/hansel-key-rsa.pem (valid until
May 2048).
- Validate blob algorithm name against handshake pubKeyId
- Derive curve from negotiated algo, not the key blob
- Check curve name instead of skipping it
- Add a ParseECCPubKey test checking the key blob algorithm and
curve names are validated against the negotiated host key
algorithm.
Issue: #1012
- GetMpint now rejects values with the sign bit set as
non-canonical (RFC 4251 Section 5) and is rewritten in
terms of GetStringRef.
- Parse RSA signature blobs with GetStringRef; they are
strings of raw signature bytes (RFC 4253 Section 6.6),
not mpints, and often have the high bit set.
- Add unit test covering GetMpint parsing and rejection.
- Add a DoUserAuthRequestRsa test pinning the string parse of
the signature blob with a fixed signature whose leading byte
has the high bit set; an mpint parse would reject it as
negative.
Issue: #1013
- Add CertManIntermediateIsCA: require isCA and, for non-self-signed
intermediates that carry a KeyUsage extension, the keyCertSign bit
before promoting a cert.
- Only promote a verified intermediate into the trust store when it is
actually a CA; otherwise fail with WS_CERT_NO_SIGNER_E.
- Prevents a peer-supplied end-entity cert at an intermediate position
from being trusted to issue certs for arbitrary SSH principals.
- Gate keyCertSign on ALLOW_INVALID_CERTSIGN and on the KeyUsage
extension being present, matching wolfSSL's AddCA loader.
- Add regression tests: non-CA intermediate is not promoted, and a
valid CA intermediate (with and without KeyUsage) still is.
Issue: F-5851
- Per RFC 4253 4.2 use WSTRNCMP instead of WSTRNCASECMP for
prefix and full-ID comparisons.
- Update client tests; add server test vectors expecting
rejection of lowercase/mixed case.
Issue: F-2865
- Reject SSH_MSG_NEWKEYS when len != 0 per RFC 4253 7.3.
- Update wolfSSH_TestDoNewKeys to take buf/len/idx instead
of assuming NULL/0, and add a non-zero len test case.
Issue: F-2079
- Without the guard, inner loops short-circuit and WS_SUCCESS
is returned without any verification.
- Add test case covering the new and existing bad-arg paths.
Issue: F-409