userauth: fix auth-cap counting gaps#1127
Merged
Merged
Conversation
ejohnstown
commented
Jul 23, 2026
Contributor
- Charge abandoned keyboard INFO_REQUEST before method dispatch so a peer can't dodge the cap; drop unused "counted" param.
- Exempt the opening "none" probe in DoUserAuthRequestNone() under WOLFSSH_ALLOW_USERAUTH_NONE, matching ssh.h contract.
- unit.c: add keyboard restart, setup-rejection, and none-exemption MaxAuthAttempts scenarios.
- api.c: assert "none" cipher/MAC accepted under WOLFSSH_ALLOW_NONE_CIPHER.
- Charge abandoned keyboard INFO_REQUEST before method dispatch so a peer can't dodge the cap; drop unused "counted" param. - Exempt the opening "none" probe in DoUserAuthRequestNone() under WOLFSSH_ALLOW_USERAUTH_NONE, matching ssh.h contract. - unit.c: add keyboard restart, setup-rejection, and none-exemption MaxAuthAttempts scenarios. - api.c: assert "none" cipher/MAC accepted under WOLFSSH_ALLOW_NONE_CIPHER.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes gaps in server-side auth-attempt accounting around keyboard-interactive restarts/abandoned INFO_REQUEST exchanges and the initial "none" probe, and expands tests to cover these edge cases. This helps ensure MaxAuthAttempts is enforced consistently and can’t be bypassed via method interleaving.
Changes:
- Charge abandoned keyboard-interactive INFO_REQUEST attempts before dispatching the next auth method; simplify keyboard request helper signature.
- Exempt the initial
"none"probe from auth-attempt counting (including when"none"is treated as an invalid method vs. handled byDoUserAuthRequestNone()). - Add/extend unit and API tests for the above behaviors and for
"none"cipher/MAC acceptance underWOLFSSH_ALLOW_NONE_CIPHER.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wolfssh/internal.h | Updates the keyboard-interactive request function declaration to drop the unused parameter. |
| src/internal.c | Adjusts auth-failure charging logic for abandoned keyboard-interactive exchanges and initial "none" probe exemption. |
| tests/unit.c | Adds unit coverage for none-probe exemption and keyboard-interactive restart/setup-rejection max-attempt scenarios. |
| tests/api.c | Extends algo-list API tests to validate "none" cipher/MAC behavior when enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JacobBarthelmeh
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.