Opened 7 years ago

Closed 7 years ago

#4428 enhancement closed fixed (fixed)

feature: let twisted.conch.ssh.transport supported ssh version to be overriden

Reported by: alanfranzoni Owned by:
Priority: normal Milestone:
Component: conch Keywords:
Cc: Branch: branches/conch-supported-versions-check-4428
branch-diff, diff-cov, branch-cov, buildbot
Author: alanfranzoni

Description

Currently, twisted.conch.ssh.transport ssh protocol supported versions are hardcoded into the dataReceived method, and cannot be overriden. While this isn't usually a problem, some half-baked ssh implementations do sometimes return a strange version number (notably, 2.99) even though the protocol version is actually 2.0.

While this shouldn't be hardcoded in the transport, since it's actually a protocol glitch, this patch allows SSHTransportBase subclassers to override supported version numbers without rewriting the dataReceived method, if this is necessary.

Attachments (2)

4428.patch (2.0 KB) - added by alanfranzoni 7 years ago.
4428-bis.patch (4.4 KB) - added by alanfranzoni 7 years ago.

Download all attachments as: .zip

Change History (14)

Changed 7 years ago by alanfranzoni

Attachment: 4428.patch added

comment:1 Changed 7 years ago by alanfranzoni

Keywords: review added
Owner: z3p deleted

Patch attached. Please note that INotify tests on current twisted trunk actually fail on my machine - but they seem to fail without the patch as well, it seems a totally unrelated issue.

comment:2 Changed 7 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to alanfranzoni

Thanks. Can you also add a unit test for this feature?

Changed 7 years ago by alanfranzoni

Attachment: 4428-bis.patch added

comment:3 Changed 7 years ago by alanfranzoni

Keywords: review added
Owner: alanfranzoni deleted

I had to patch the whole thing a bit more in order to write a proper unit test. I hope this is fine now.

comment:4 Changed 7 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/conch-supported-versions-check-4428

(In [28914]) Branching to 'conch-supported-versions-check-4428'

comment:5 Changed 7 years ago by Jean-Paul Calderone

(In [28915]) Apply alanfranzoni's patch

refs #4428

comment:6 Changed 7 years ago by Jean-Paul Calderone

Author: exarkunalanfranzoni

comment:7 Changed 7 years ago by Jean-Paul Calderone

(In [28963]) fix typo in docstring

refs #4428

comment:8 Changed 7 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to Jean-Paul Calderone

Thanks. I checked the patch into a branch, fixed some simple doc issues and some coding standard problems, but the basic change looks good to me.

comment:9 Changed 7 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [28972]) Merge conch-supported-versions-check-4428

Author: alanfranzoni Reviewer: exarkun Fixes: #4428

Add an overrideable attribute which can be used to control the declared protocol versions SSHTransportBase considers supported.

comment:10 Changed 7 years ago by Jean-Paul Calderone

Resolution: fixed
Status: closedreopened

(In [28975]) Revert r28972 - doc formatting regression

The new _unsupportedVersionReceived method's docstring is not valid epytext.

Reopens #4428

comment:11 Changed 7 years ago by Jean-Paul Calderone

Resolution: fixed
Status: reopenedclosed

(In [28979]) Merge conch-supported-versions-check-4428

Author: alanfranzoni Reviewer: exarkun Fixes: #4428

Add an overrideable attribute which can be used to control the declared protocol versions SSHTransportBase considers supported.

comment:12 Changed 6 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.