Skip to content

x/crypto/ssh: write errors should be returned immediately #57531

Open
@willmo

Description

@willmo

Apologies if this is a duplicate or not actually a bug.

What version of Go are you using (go version)?

$ go version
go version go1.18.4 linux/amd64

x/crypto master

Does this issue reproduce with the latest release?

Yes, this behavior hasn't changed since it was introduced in golang/crypto@2e74c77 .

What did you do?

Write to a channel of an SSH connection that's interrupted, e.g. by receiving a TCP RST.

What did you expect to see?

A write error is reported as soon as writing to the underlying net.Conn fails.

What did you see instead?

The error is reported only on subsequent writes. This is not a dire problem, but seems odd/unnecessary.

In particular, handshakeTransport.writePacket sets t.writeError but returns nil. This seems to have been introduced in the aforelinked golang/crypto@2e74c77 .

Is there a missing return err here? If so, I can submit a CL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions