Commit Graph

71 Commits (c71202ffdb92202cc53bd520ee45f438d2edded4)

Author SHA1 Message Date
John Safranek 44bd4a06f4 Compose sshd_config Match blocks per keyword
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
2026-08-25 14:30:39 -06:00
Yosuke Shimizu 6579f59236 wolfsshd: base Match blocks on the global config and keep included ones 2026-08-11 18:13:34 -07:00
John Safranek 773febc60c wolfsshd: compare the terminated copy in GetConfigInt
- 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
2026-08-02 22:10:24 -05:00
Emma Stensland 22063423cd F-6700: Add PermitRootLogin prohibit-password and forced-commands-only modes 2026-07-31 15:44:47 -07:00
Yosuke Shimizu cc5311a829 wolfsshd: open PID file with O_NOFOLLOW and a fixed mode 2026-07-20 20:02:53 -05:00
Yosuke Shimizu a10e6e5c0c wolfsshd: bind FPKI certificate UPN realm to AuthorizedUPNDomains 2026-07-20 20:01:10 -05:00
aidan garske 4a50777e04 F-4108 - Build full path and check lstat return in QNX Include scan 2026-07-20 17:24:02 -05:00
Yosuke Shimizu 323ec15bb0 wolfsshd: add StrictModes and secure loading of trust anchors 2026-06-26 14:13:02 -07:00
Yosuke Shimizu 6bdddc6053 wolfsshd: mark AuthorizedKeysFile as explicitly set in public setter 2026-06-25 13:35:27 -07:00
Yosuke Shimizu 281e4bc19f Treat combined Match User/Group blocks as a conjunction in wolfsshd 2026-06-23 14:57:09 -07:00
Yosuke Shimizu 1d2b95f979 wolfsshd: fix Match User/Group directive misparse 2026-06-18 14:24:09 -07:00
Yosuke Shimizu ef56aca663 wolfsshd: fix uninitialized fileNames[] deref in HandleInclude 2026-06-18 13:46:05 -07:00
Yosuke Shimizu 253c157066 wolfsshd: implement PubkeyAuthentication config directive 2026-06-18 13:08:14 -07:00
Yosuke Shimizu 7393aaea9b wolfsshd: reject Match blocks using unimplemented selectors 2026-06-16 15:38:16 -07:00
John Safranek 69f7799929 Check Include path truncation in sshd config
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.
2026-06-15 21:48:30 -07:00
John Safranek 1d86a8ed27 Bound sshd Include directive recursion
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.
2026-06-09 17:18:39 -07:00
Yosuke Shimizu 2d0ef5aee4 wolfsshd: honor Match-block auth restrictions in DoCheckUser and RequestAuthentication 2026-06-08 14:54:28 -07:00
Yosuke Shimizu fb1aa6daba Fix minor issues and Add test vectors 2026-05-14 09:36:43 -07:00
Yosuke Shimizu 7d7d04dc70 Fix minor issues and Add unit test for wrong padded OpenSSH key 2026-05-12 13:14:56 -07:00
Yosuke Shimizu b557998ddf Add default loginTimer 2026-04-23 10:19:13 -07:00
Yosuke Shimizu 97a0c7b5b7 Fix wolfSSHD_ConfigCopy and wolfSSHD_ConfigFree, and Add the regression test 2026-04-17 17:31:40 +09:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
John Safranek 8951bd9209 Release v1.4.22
1. Update copyright date to 2026.
2025-12-29 16:53:33 -08:00
John Safranek 7fc63e86bf SSHD Banners
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.
2024-07-08 10:02:41 -07:00
John Safranek 1736a4cabf
Update Copyright Date
1. Bring all copyright dates up to 2024.
2. Fix a few files with incorrect licensing.
2024-03-22 12:17:09 -07:00
John Safranek 3feaad95af
Release v1.4.15: Release Testing Fixes
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.
2023-12-22 11:05:15 -08:00
JacobBarthelmeh 827d901f52 add sanity check that pid file is not null 2023-09-20 16:32:50 -06:00
JacobBarthelmeh c349510cc3 add include of process.h for _getpid and add a cast to fix warning 2023-09-20 13:29:33 -06:00
JacobBarthelmeh 12b7c3af93 add Windows version of getpid 2023-09-20 11:16:35 -06:00
John Safranek 491f3dce57 WMACRO Update
1. Fix missing updates to wolfSSHd.
2. Fix missing update to scp.
2023-09-01 09:34:26 -07:00
John Safranek d4fa4ebd69
Merge branch 'master' into pull-reqs/f4021bb_All_the_filesystem-related_W_macros_accept_a_filesystem_context_pointer_as_first_parameter 2023-09-01 09:08:34 -07:00
JacobBarthelmeh 034ed7fe9f fix ups for format, spelling, includes, and string compare 2023-08-30 13:32:17 -07:00
JacobBarthelmeh ab742ca766 wolfSSHd port to Windows
handling of terminal size adjustments

stub case for ECH virtual terminal command
2023-08-30 09:08:25 -07:00
JacobBarthelmeh 8d9b30d9a9 add PidFile and -t support 2023-07-25 08:55:43 -07:00
Fabio Alemagna 092c04fe30 All the filesystem-related W* macros accept a filesystem context pointer as first parameter, to make portability better. 2023-07-21 11:53:40 +02:00
JacobBarthelmeh 57f07802a2 fix warnings for g++ build 2023-07-05 15:10:48 -07:00
John Safranek 95bcc4541c
Release v1.4.13
1. Update the copyright year in all file header comments.
2. Update the STM32CUBE files to use the correct GPL headers.
2023-04-03 10:41:10 -07:00
JacobBarthelmeh f844683c13 remove leading tabs in config file while parsing, add force command test 2023-01-23 14:25:08 -08:00
JacobBarthelmeh 657db7cd7e allow verify of public key with no authorized keys file if using a CA 2022-09-07 14:40:55 -07:00
JacobBarthelmeh 3e1a6ff342 add mutual X509 auth of host key and sshd_config parsing additions 2022-09-06 16:15:34 -07:00
Hayden Roche 7c486e518a initial openssh-style certificate parsing 2022-09-06 15:56:42 -07:00
John Safranek c1f473d52b
Merge pull request #449 from JacobBarthelmeh/qnx
fix for DIR with QNX
2022-09-01 13:32:41 -07:00
John Safranek c8bdf7d3d2
Merge pull request #441 from JacobBarthelmeh/sshd
add chroot jailing to sshd
2022-09-01 13:28:52 -07:00
JacobBarthelmeh 331753c776 fix up if statement after cherry pick 2022-09-01 13:08:05 -07:00
JacobBarthelmeh fb0d3ba3d1 fix for DIR with QNX 2022-09-01 12:56:50 -07:00
John Safranek 76417aca88
Wildcard Config
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.
2022-08-29 17:12:55 -07:00
John Safranek 4d43d8406e
Wildcard Config
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.
2022-08-29 13:45:45 -07:00
JacobBarthelmeh 8a286ad727 remove duplicate code and raise permissions for chroot 2022-08-29 09:27:42 -07:00
JacobBarthelmeh e1f0a67c38 add chroot jailing to sshd 2022-08-29 09:27:42 -07:00
John Safranek a01d31592c
Wildcard
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.
2022-08-26 12:41:00 -07:00