SSH_MSG_SERVICE_ACCEPT is not received at the sftp client

Shinose shinose at gmail.com
Thu Feb 12 23:42:24 AEDT 2015


Hi All,

I am currently trying to port sshd and sftpserver to an embedded OS
which is having a Single Monolith Process Space.

Hence I have converted the whole openssh code re-entrant for the RTOS tasks.

The re-entrant code is tested and is working under Linux.

But once I started the sshd running on the target, it looks like the
sshd sends the SSH_MSG_SERVICE_ACCEPT but is NOT received by the sftp
client.

Hence the client infinitely waits after sending
SSH2_MSG_SERVICE_REQUEST and no further communication is happening.

The sshd is in the select() loop as normal after sending the
SSH_MSG_SERVICE_ACCEPT packet.

It would be highly helpful if you could put some pointers to overcome
this issue.

Following is the client and server logs.

sftp client log (Ubuntu) : http://pastebin.com/9697H7Y7
...
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent

sshd log (RTOS) : http://pastebin.com/3U3Mw2d9
...
I/O: debug2: set_newkeys: mode 1
I/O: debug2: cipher_init_context: 1
I/O: debug2: packet_send done
I/O: debug2: SSH2_MSG_NEWKEYS sent
I/O: debug2: expecting SSH2_MSG_NEWKEYS
I/O: debug2: packet_read()
I/O: debug2: input: packet len 16
I/O: debug2: partial packet: block 8, need 8, maclen 0, authlen 0, aadlen 0
I/O: read_poll enc/full: 0000 0000 0000 0000
I/O: debug2: input: padlen 10
I/O: debug2: input: len before de-compress 1
I/O: debug2: set_newkeys: mode 0
I/O: debug2: cipher_init_context: 0
I/O: read/plain[21]:
I/O:
I/O: debug2: received packet type 21
I/O: debug2: SSH2_MSG_NEWKEYS received
I/O: debug2: KEX done
I/O: debug2: packet_read()
I/O: debug2: input: packet len 32
I/O: debug2: partial packet: block 16, need 16, maclen 16, authlen 0, aadlen 0
I/O: read_poll enc/full: 80e5 0ff5 e0c5 6f48 62cb 4383 6c43 2e98
I/O: b28a 3677 5765 5d81 fc18 b389 9f5d e203
I/O:
I/O: debug2: MAC #4 ok
I/O: debug2: input: padlen 10
I/O: debug2: input: len before de-compress 17
I/O: read/plain[5]:
I/O: 0000 000c 7373 682d 7573 6572 6175 7468
I/O:
I/O: debug2: received packet type 5
I/O: debug2: packet_start[6]
I/O: plain:     0000 0000 0006 0000 000c 7373 682d 7573
I/O: 6572 6175 7468
I/O: debug2: send: len 32 (includes padlen 10, aadlen 0)
I/O: debug2: done calc MAC out #4
I/O: encrypted: 77c1 c72a 976c 4e1e 0461 8a11 5391 9d0d
I/O: d85d db30 73f1 0286 11a4 add3 8e07 4b5b
I/O:
I/O: debug2: packet_send done
I/O: debug2: packet_read()


Thanks,
Shinose.


More information about the openssh-unix-dev mailing list