Skip to content

userauth: fix auth-cap counting gaps#1127

Merged
JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
ejohnstown:sf11-tests
Jul 23, 2026
Merged

userauth: fix auth-cap counting gaps#1127
JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
ejohnstown:sf11-tests

Conversation

@ejohnstown

Copy link
Copy Markdown
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.

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.

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 by DoUserAuthRequestNone()).
  • Add/extend unit and API tests for the above behaviors and for "none" cipher/MAC acceptance under WOLFSSH_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.

Comment thread wolfssh/internal.h
@JacobBarthelmeh
JacobBarthelmeh merged commit 35ef7b2 into wolfSSL:master Jul 23, 2026
141 checks passed
@ejohnstown
ejohnstown deleted the sf11-tests branch July 23, 2026 20:55
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.

3 participants