Opened 4 years ago

Closed 4 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
(diff, github, buildbot, log)
Author: alanfranzoni Launchpad Bug:

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 4 years ago.
4428-bis.patch (4.4 KB) - added by alanfranzoni 4 years ago.

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by alanfranzoni

comment:1 Changed 4 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 4 years ago by exarkun

  • Keywords review removed
  • Owner set to alanfranzoni

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

Changed 4 years ago by alanfranzoni

comment:3 Changed 4 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 4 years ago by exarkun

  • Author set to exarkun
  • Branch set to branches/conch-supported-versions-check-4428

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

comment:5 Changed 4 years ago by exarkun

(In [28915]) Apply alanfranzoni's patch

refs #4428

comment:6 Changed 4 years ago by exarkun

  • Author changed from exarkun to alanfranzoni

comment:7 Changed 4 years ago by exarkun

(In [28963]) fix typo in docstring

refs #4428

comment:8 Changed 4 years ago by exarkun

  • Keywords review removed
  • Owner set to exarkun

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 4 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by exarkun

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

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

Reopens #4428

comment:11 Changed 4 years ago by exarkun

  • Resolution set to fixed
  • Status changed from reopened to closed

(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 3 years ago by <automation>

  • Owner exarkun deleted
Note: See TracTickets for help on using tickets.