| Summary: | can't login | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | IgorK <igor> |
| Component: | ssh | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | CLOSED INVALID | ||
| Severity: | normal | CC: | djm, dtucker |
| Priority: | P5 | ||
| Version: | 7.4p1 | ||
| Hardware: | 68k | ||
| OS: | Mac OS X | ||
|
Description
IgorK
2017-05-29 20:45:59 AEST
it is working if in ssh client ssh_config enable: MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 and use ssh by: ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 sirius@192.168.1.201 i was able to connect to lantronix spyder box This looks like a bug in the old dropbear server - it's dropping the connection without giving any reason why. Without understanding what is happening at the server, there isn't much the client can do here. I tried reproducing this with a local build of that (12 year old!) version of dropbear. Surprisingly I was able to reproduce it. On the sever it says:
[32036] Jun 23 13:56:04 Child connection from 127.0.0.1:41420
[32036] Jun 23 13:56:04 exit before auth: bad buf_getwriteptr
After some experimentation, it seems to be related to the total size of the KEX proposal (I'd guess <512 bytes). If we keep adding redundant MACs to the proposal it fails when the MAC list gets to 350 bytes:
$ mac=hmac-sha1; while ssh -p 2022 -o hostkeyalgorithms=ssh-dss -o kexalgorithms=diffie-hellman-group1-sha1 -caes128-cbc -m $mac localhost echo ok; do mac="$mac,hmac-sha1"; echo -n "`echo $mac | wc -c` "; done
[...]
330 ok
340 ok
350 Connection closed by 127.0.0.1 port 2022
If you make any of the other algorithm lists longer then it'll fail correspondingly earlier.
So, it's a bug or implementation limit in the server. You can work around it on the client side as you have discovered.
The client could conceivably use the bug bits in compat.{c,h} to limit what it sends in these cases but I'm not sure it's worth the complexity.
Since it's a bug in such an old server I don't think OpenSSH should try to work around it. You should probably get the server upgraded, but if you can't you can configure around it. closing resolved bugs as of 8.6p1 release |