Opened 4 years ago

Closed 4 years ago

#9422 defect closed fixed (fixed)

conch mishandles MSG_DEBUG always_display field on Python 2

Reported by: Colin Watson Owned by: Mark Williams <mrw@…>
Priority: normal Milestone:
Component: conch Keywords:
Cc: Branch:


The OpenSSH 7.7p1 interoperability regression tests fail when run against conch. The proximate cause was a change in OpenSSH that resulted in more MSG_DEBUG messages being sent in the test in question, but it's not an OpenSSH bug. Rather, the bug is in conch: when the always_display field (called alwaysDisplay by Twisted) is false, and conch is running under Python 2, it incorrectly interprets the field as true and displays the message anyway.

To reproduce, run an OpenSSH 7.7p1 server on a port of your choice, make sure that you have a key that it will consider as authorized (using ~/.ssh/authorized_keys), then do something like this:

python2 -m twisted.conch.scripts.conch --identity ~/.ssh/id_rsa --port <port> --known-hosts ~/.ssh/known_hosts -n localhost 'cat /etc/hosts' | diff -u /etc/hosts -

There should be no diff, but instead, you'll see something like this at the end, corresponding to MSG_DEBUG messages sent by OpenSSH:

+/home/cjwatson/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
+/home/cjwatson/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding

This is fine under python3 (at least on HEAD - 17.9.0 blew up for some unrelated reason that's since been fixed).

I'm working on a patch.

Change History (3)

comment:1 Changed 4 years ago by Colin Watson

Keywords: review added

comment:2 Changed 4 years ago by mark williams

Keywords: review removed

Thanks for the fantastic explanation and reproducing case!

comment:3 Changed 4 years ago by Mark Williams <mrw@…>

Owner: set to Mark Williams <mrw@…>
Resolution: fixed
Status: newclosed

In 22bc980f:

Error: Processor CommitTicketReference failed
 does not appear to be a Git repository. See the log for more information.
Note: See TracTickets for help on using tickets.