Skip to content

Fix minor issues and Add test vectors#979

Merged
ejohnstown merged 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fAnalysis
May 14, 2026
Merged

Fix minor issues and Add test vectors#979
ejohnstown merged 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fAnalysis

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

This PR fixes the following things:

  • Remove dead check in scp_client()
  • Fix input validation in GetConfigInt()
  • Fix attributes validation in wolfSSH_SFTP_RecvMKDIR()

Also, this adds the test vector for GetConfigInt().

Addressed by f_3443, f_3670 and f_3875.

@yosuke-wolfssl yosuke-wolfssl self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 08:28
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 makes three small fixes plus a corresponding test addition: it removes a dead conditional in the SCP client example, hardens GetConfigInt() against NULL/empty input, and replaces the manual single-flag attribute parsing in wolfSSH_SFTP_RecvMKDIR() with the canonical SFTP_ParseAttributes_buffer() helper.

Changes:

  • Remove unreachable err_sys("Couldn't set the channel type.") block in scp_client().
  • Validate in/inSz in GetConfigInt() and use else if for the h multiplier; add tests for bare m/h values.
  • Use SFTP_ParseAttributes_buffer() in wolfSSH_SFTP_RecvMKDIR() so permission attributes can be honored even when combined with other flags.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
examples/scpclient/scpclient.c Removes dead duplicate ret != WS_SUCCESS check after socket-set call.
apps/wolfsshd/configuration.c Adds NULL/empty input guard and makes m/h multiplier checks mutually exclusive in GetConfigInt().
apps/wolfsshd/test/test_configuration.c Adds test vectors for bare m/h multiplier values to LoginGraceTime.
src/wolfsftp.c Replaces ad-hoc attribute flag parsing in MKDIR handler with SFTP_ParseAttributes_buffer(), honoring WOLFSSH_FILEATRB_PERM when set alongside other flags.

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

@ejohnstown ejohnstown merged commit fb1aa6d into wolfSSL:master May 14, 2026
131 checks passed
@yosuke-wolfssl yosuke-wolfssl deleted the fAnalysis branch May 14, 2026 23:05
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