Skip to content

Conversation

@JacobBarthelmeh
Copy link
Contributor

ZD20321

WinSCP fails to connect with "SCP" and "Default" shell used. This is because WinSCP is opening a shell subsystem but not using pty-req and expecting the server to create a non-interactive shell. wolfSSHd previously would send interactive terminal characters which confused WinSCP leading to it hanging after the SSH handshake was completed.

@JacobBarthelmeh JacobBarthelmeh self-assigned this Sep 16, 2025
Copy link

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 fixes WinSCP connection issues by preventing wolfSSHd from treating shells as interactive until a pty-req is received. Previously, WinSCP would hang after SSH handshake because wolfSSHd was sending interactive terminal characters even when no PTY was requested.

  • Added a new ptyReq flag to track when an interactive PTY request is received
  • Modified shell subsystem logic to use non-interactive mode by default
  • Added API function to check if PTY request was received

Reviewed Changes

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

Show a summary per file
File Description
wolfssh/ssh.h Added new API function declaration for checking PTY request status
wolfssh/internal.h Added ptyReq flag to WOLFSSH struct to track PTY request state
src/ssh.c Implemented the new API function to return PTY request status
src/internal.c Set the ptyReq flag when processing channel PTY requests
apps/wolfsshd/wolfsshd.c Modified shell subsystem to use non-interactive mode unless PTY is requested
Comments suppressed due to low confidence (1)

src/ssh.c:266

  • Inconsistent indentation: this line uses tabs while the surrounding code uses spaces. Should use consistent spacing throughout the function.
    return 0;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacobBarthelmeh JacobBarthelmeh changed the title do not treat shell as interactive untill pty-req recieved do not treat shell as interactive until pty-req received Sep 16, 2025
Copy link

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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacobBarthelmeh
Copy link
Contributor Author

Great feedback. I refactored the flag to be at the Channel level and adjust the checks on the flag in wolfsshd.c

@ejohnstown ejohnstown self-requested a review September 19, 2025 16:28
@ejohnstown ejohnstown merged commit 2a21844 into wolfSSL:master Sep 19, 2025
93 checks passed
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