f



protocol question - issue with exit-status inside unfinished data stream?

Hi list,

I am using a Java library (ganymed ssh2) to connect to a remote server usin=
g a terminal session. This has worked fine for years, but since a few month=
s I get intermittent errors where a terminal session is closed in the middl=
e of a data stream.

For example, I execute "ps -ef" on the remote and it fails with only half t=
he data present.

To find out what happens I have patched and recompiled the Ubuntu 14.04 pac=
kage  openssh-server_6.6p1-2ubuntu2.8_amd64.deb with support for the none c=
ipher, and have done the same inside the ganymed source code. This at least=
 allows me to decode the ssh protocol - it is not meant to stay, it's only =
for debugging.=20

What I see when I look at the stream is what appears to be something wrong =
in the data sent by the server. At the point where the code dies I see:

03a0   20 20 20 20 20 32 20 20 30 20 6f 6b 74 30 39 20       2  0 okt09=20
03b0   3f 20 20 20 20 20 20 20 20 30 30 3a 30 30 3a 30  ?        00:00:0
03c0   30 20 5b 7a 5f 77 72 5f 69 6e 74 5f 34 5d 0d 0a  0 [z_wr_int_4]..
03d0   00 00 00 00 d7 ab 5d d3 84 58 14 09 f4 82 73 db  ......]..X....s.
03e0   00 00 00 4c 04 5e 00 00 00 64 00 00 00 3e 72 6f  ...L.^...d...>ro
03f0   6f 74 20 20 20 20 20 20 31 34 32 32 20 20 20 20  ot      1422   =20
0400   20 32 20 20 30 20 6f 6b 74 30 39 20 3f 20 20 20   2  0 okt09 ?  =20
0410   20 20 20 20 20 30 30 3a 30 30 3a 30 30 20 5b 7a       00:00:00 [z
0420   5f 77 72 5f 69 6e 74 5f 34 5d 0d 0a 00 00 00 00  _wr_int_4]......
0430   5a c4 fb 39 4c d2 c7 1d b8 4c 4d ed 00 00 00 24  Z..9L....LM....$
0440   0a 62 00 00 00 64 00 00 00 0b 65 78 69 74 2d 73  .b...d....exit-s
          ^ SSH_MSG_CHANNEL_REQUEST (98)
             ^ recipient channel
                         ^ String "exit-status"
0450   74 61 74 75 73 00 00 00 00 00 00 00 00 00 00 00  tatus...........
                      ^ boolean false?
                                  ^ exit-status uint32
                                              ^^??
0460   00 00 00 00 2e 77 03 ed 72 57 06 20 47 c9 c1 bb  .....w..rW. G...
0470   00 01 00 14 0a 5e 00 00 00 64 00 01 00 00 72 6f  .....^...d....ro
                      ^ channel_data
0480   6f 74 20 20 20 20 20 20 31 34 32 33 20 20 20 20  ot      1423   =20
0490   20 32 20 20 30 20 6f 6b 74 30 39 20 3f 20 20 20   2  0 okt09 ?  =20
04a0   20 20 20 20 20 30 30 3a 30 30 3a 30 30 20 5b 7a       00:00:00 [z
04b0   5f 77 72 5f 69 6e 74 5f 34 5d 0d 0a 72 6f 6f 74  _wr_int_4]..root
04c0   20 20 20 20 20 20 31 34 32 34 20 20 20 20 20 32        1424     2
04d0   20 20 30 20 6f 6b 74 30 39 20 3f 20 20 20 20 20    0 okt09 ?    =20
04e0   20 20 20 30 30 3a 30 30 3a 30 30 20 5b 7a 5f 77     00:00:00 [z_w
04f0   72 5f 69 6e 74 5f 34 5d 0d 0a 72 6f 6f 74 20     r_int_4]..root=20

The exit-status message seems to be in the middle of a data stream that is =
not yet complete. According to the RFC this should not be possible if I rea=
d it right, and the Ganymed library closes the connection after receiving t=
hat exit-status.

My question is: has something changed regarding that exit-status? Should th=
e java library wait until a real close is received with cancelling the read=
?

Thanks in advance for your time,

Frits
0
jal
10/10/2016 8:46:09 PM
comp.security.ssh 4228 articles. 0 followers. terra1024 (490) is leader. Post Follow

0 Replies
201 Views

Similar Articles

[PageSpeed] 0

Reply: