Skip to content

wolfsshd: honor none keywords, refuse Match Group - #1348

Open
ejohnstown wants to merge 3 commits into
wolfSSL:masterfrom
ejohnstown:match-keys
Open

ejohnstown wants to merge 3 commits into
wolfSSL:masterfrom
ejohnstown:match-keys

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

AuthorizedKeysFile none and ChrootDirectory none now mean what they do
in OpenSSH, and Windows wolfsshd refuses Match Group, which it could
never apply.

  • AuthorizedKeysFile none turns off the keys file instead of naming
    ~/none; X.509 does not fall back to CA-only under it
  • ChrootDirectory none means no chroot, so a Match block can exempt a
    user from a global one
  • Windows refuses a Match Group block; the Windows check tests it

Issue: F-15558, F-16811, F-15559

"AuthorizedKeysFile none" now turns off the authorized keys file, as
in OpenSSH, instead of naming ~/none, a file the user controls. The
value stays "none" through Match composition, and SearchForPubKey
refuses it before resolving any path.

- match "none" case-insensitively, as OpenSSH does
- OpenSSH certificates still check against TrustedUserCAKeys
- X.509 certificates do not fall back to CA-only under "none"
- a "none" node passes the wolfSSH_TrustedSystemCAKeys startup gates
- add sshd_authkeys_none_test.sh: key in ~/none, X.509 CA-only and
  system CA gate cases, each set globally and in a Match block

Issue: F-15558
"ChrootDirectory none" now means no chroot, as in OpenSSH, instead of
a relative chdir() target. The keyword still counts as set, so a Match
block using it exempts a user from a global ChrootDirectory.

- match "none" case-insensitively, as OpenSSH does
- add sshd_chroot_none_test.sh: global and Match cases against an
  empty global chroot

Issue: F-16811
Windows wolfsshd does not look up a user's groups, so a Match Group
block could never apply and its restrictions were skipped. The config
load now rejects a Group selector there, as it does other unsupported
Match selectors.

- WOLFSSHD_NO_MATCH_GROUP gates the rejection, set for _WIN32
- add sshd_match_group_win_test.ps1 to the Windows check workflow

Issue: F-15559
Copilot AI balanced review requested due to automatic review settings October 28, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants