Skip to content

Add upper limit of max window size and packet size, Add unit tests#995

Open
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fix/f_5572
Open

Add upper limit of max window size and packet size, Add unit tests#995
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fix/f_5572

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

This PR adds following things:

  • Adds upper bounds for maximum window size and packet size to harden wolfSSH_CTX_SetWindowPacketSize.
  • Adds unit tests to exercise it.

Addressed by f_5572

@yosuke-wolfssl yosuke-wolfssl self-assigned this Jun 1, 2026
Copilot AI review requested due to automatic review settings June 1, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens wolfSSH_CTX_SetWindowPacketSize() by introducing compile-time upper bounds for accepted window and packet sizes, and adds a unit test to validate the new behavior.

Changes:

  • Added WINDOW_SZ_UPPER_BOUND and MAX_PACKET_SZ_UPPER_BOUND constants.
  • Enforced the new upper bounds in wolfSSH_CTX_SetWindowPacketSize().
  • Added an API unit test covering defaulting behavior and boundary/overflow cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
wolfssh/internal.h Defines upper-bound macros for window and packet size accepted by wolfSSH_CTX_SetWindowPacketSize().
src/ssh.c Adds validation logic to reject window/packet sizes above the configured upper bounds.
tests/api.c Adds a unit test for wolfSSH_CTX_SetWindowPacketSize() covering defaults and upper-bound checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ssh.c Outdated
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #995

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfssh/internal.h Outdated
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.

4 participants