wolfSSHD_GetUserConf returned the first matching Match block whole, so a
keyword named only in a later matching block was dropped and the outcome
depended on the order the blocks were written.
- track in a new setMask which keywords a node set itself, so a value
inherited from the globals can be told from one the block named, with a
compile time check that no option tag shifts out of the mask
- resolve into a fresh config seeded from the globals, letting every
matching block contribute the keywords no earlier block claimed
- the resolved config now belongs to the caller, so wolfsshd and the auth
paths free it and the tests compare values rather than node identity
- put sshd_match_overlap_test.sh back in the suite
Issue: ZD-22324
- The zero check ran WSTRCMP() on the caller's buffer, which is a
length-bounded slice of the config line and not NUL terminated, so it
read past inSz and rejected valid "0" values whose slice had trailing
text.
- Compare num, the NUL-terminated copy that atol() was given.
Issue: F-7213
HandleInclude built the wildcard include path with WSNPRINTF without
checking the result, silently truncating over-long paths (flagged by
GCC 12 as -Werror=format-truncation). Merge the duplicate WSNPRINTF
calls and return WS_INVALID_PATH_E when the path does not fit.
Cleanup clang-tidy misc-no-recursion finding.
- wolfSSHD_ConfigLoad: track depth on WOLFSSHD_CONFIG
and reject loads past WOLFSSHD_MAX_INCLUDE_DEPTH (16).
- HandleInclude, HandleConfigOption, ParseConfigLine,
wolfSSHD_ConfigLoad: annotate the call cycle with
NOLINTNEXTLINE pointing at the bound.
- Add a recursive configuration test.
1. Add getting the banner option from the configuration file. Per the
sshd_config(5) manpage, this is supposed to be a filename.
2. Load the banner file and set the banner into the CTX.
1. Add a check for limits.h to configure.ac.
2. In wolfSSHd's configuration.c file, add an include of limits.h if
available. It is including the header indirectly while using it
directly.
1. Modify HandleInclude() to have a single return point, and minimize
the places where free() needs to be called.
2. Modify the config test wildcard include test file creation to return
error similar other test functions.
3. Fix leak of the test configuration object in the wolfSSHd
configuration test.
1. Update WMALLOCs to use the config's heap and proper DYNTYPE values.
2. Covert more STDC functions to use the wrapper macros.
3. Check some missed return values on mallocs, and make sure to free
all allocated buffers.
1. Revise to use the porting functions.
2. Add test cases to check the config wildcards.
3. Generate test files for the wildcard test, and delete them after.