Commit Graph

57 Commits

Author SHA1 Message Date
Matt Johnston
6d2d3669f3 Make keepalive handling more robust, this should now match what OpenSSH does 2014-08-19 23:08:56 +08:00
Matt Johnston
10eb218fb0 Don't send SSH_MSG_UNIMPLEMENTED for keepalive responses 2014-08-13 21:48:47 +08:00
Matt Johnston
da57dd13c5 Set tcp priority as follows:
if (connecting || ptys || x11) tos = LOWDELAY;
else if (tcp_forwards) tos = 0;
else tos = BULK;

TCP forwards could be either lowdelay or bulk, hence the default priority.
2014-07-16 22:53:32 +08:00
Matt Johnston
f1826ea389 Fix auth timeout regression 2014-07-09 22:02:22 +08:00
Matt Johnston
c884e5000e Make -K keepalive behave like OpenSSH's ServerAliveInterval 2014-07-09 00:15:20 +08:00
Matt Johnston
db688e3ec1 Experiment of always writing data if available. Might waste a writev() with
EAGAIN but always saves a select() - needs testing with bandwidth-limited
and CPU-limited situations.
2014-03-15 11:37:02 +08:00
Matt Johnston
e767bbb41f Add new monotonic_now() wrapper so that timeouts are unaffected by
system clock changes
2014-03-13 23:50:09 +08:00
Matt Johnston
2b599df57a Fix typo 2014-03-13 23:08:47 +08:00
Yousong Zhou
5baa10a6b6 Use AUTH_TIMEOUT only before authdone != 1.
While at it, fix a few indentations and typo.
2014-03-13 16:28:16 +08:00
Matt Johnston
bf6f3f613d Read (and enqueue) packets from interactive input even when
we're waiting for a key exchange.

This should hopefully fix the situation where "~." doesn't work to terminate a
client session when a laptop wakes up. The client will be stuck waiting for a
key exchange on a dead connection, so won't have read the escape character
2014-02-17 21:41:06 +08:00
Matt Johnston
a18a6b8db8 cleanup before clearing keys 2014-02-12 22:15:02 +08:00
Matt Johnston
55a0c5068f requirenext doesn't need two values 2014-01-23 22:25:52 +08:00
Matt Johnston
cbe63bbabe rename random.h to dbrandom.h since some OSes have a system random.h
--HG--
rename : random.c => dbrandom.c
rename : random.h => dbrandom.h
2013-11-14 22:05:47 +08:00
Matt Johnston
de1deaf0bd use oldstyle comments 2013-11-14 22:03:30 +08:00
Matt Johnston
04518e9e80 merge in HEAD
--HG--
branch : ecc
2013-05-21 12:09:35 +08:00
Matt Johnston
ef151888fb requirenext fixup for firstkexfollows 2013-04-14 23:16:16 +08:00
Matt Johnston
c6bdc810ab ecc kind of works, needs fixing/testing
--HG--
branch : ecc
2013-04-07 01:36:42 +08:00
Matt Johnston
a2f70a3751 Just put the version string on the queue, don't use atomicio 2013-04-03 19:23:53 +08:00
Matt Johnston
90b5691183 Run the cleanup handler also when we close due to TCP connection being closed 2013-04-01 22:26:55 +08:00
Matt Johnston
a0e931005b send out our kexinit packet before blocking to read the SSH version string 2013-03-31 00:40:00 +08:00
Matt Johnston
5ff341206e Android returns NULL for pw_crypt, set it to something else 2013-03-19 20:15:44 +08:00
Matt Johnston
2713445e91 Return immediate success for blank passwords if allowed 2012-05-09 22:37:04 +08:00
Matt Johnston
38ed870ffe Improve capitalisation for all logged strings
--HG--
extra : convert_revision : 997e53cec7a9efb7413ac6e17b6be60a5597bd2e
2011-02-23 15:50:30 +00:00
Matt Johnston
f88bed7a30 Rearrange getaddrstring() etc
--HG--
extra : convert_revision : 8a18c4a60aeaec085923d13d98fa0f93c506ceba
2009-09-01 16:38:26 +00:00
Matt Johnston
061565865c - Add the signal pipe to maxfd
--HG--
extra : convert_revision : 0a8dfaa3e5365a2004db2b55895e11f65b5cefcc
2009-03-17 22:30:25 +00:00
Matt Johnston
ff763e4005 - Get rid of decryptreadbuf, just decrypt in-place with readbuf
- Share make_mac function for both packet creation and validation
- Split recv/trans parts of key_context into their own structures

--HG--
extra : convert_revision : 043bc598c76ed43625987e6937e32238f7ed6240
2009-03-01 16:15:57 +00:00
Matt Johnston
d1bfb6bfb7 disapproval of revision 'a101cbd046507cf723e6362a49196dbd4b924042'
--HG--
extra : convert_revision : e1c100e6366c5d607af08f4abdbb0f4281df4fa9
2009-02-26 13:20:53 +00:00
Matt Johnston
a60cb7dbaa - Try to write out as much as we can
--HG--
extra : convert_revision : a101cbd046507cf723e6362a49196dbd4b924042
2009-02-26 12:18:11 +00:00
Matt Johnston
adc4d0194f Idle timeout patch from Farrell Aultman. Needs testing, unsure if server
code works

--HG--
extra : convert_revision : ff66e05ae040561110af70114bf83f11ed528f05
2008-11-07 14:11:06 +00:00
Matt Johnston
511f6555c9 - Add Counter Mode support
--HG--
extra : convert_revision : 5225162bdf32d70b58b6d3ae375a290326c59f3a
2008-09-29 13:53:31 +00:00
Matt Johnston
e44aa503f0 - "-J 'nc localhost 22'" kind of works, needs fixing hostkeys, ptys etc.
--HG--
extra : convert_revision : 45069dd007ebf414330e0a7abf4fb7e0727049c3
2008-09-15 14:40:30 +00:00
Matt Johnston
12929e8cf0 - Add run_shell_command() function to run a "sh -c" command, handling
lots of the work that exechild did (and can be shared by client -J option)

--HG--
extra : convert_revision : a15dfd8017af8212b3b227f18ce2539dd471f7f6
2008-09-15 14:04:55 +00:00
Matt Johnston
b619e88f54 - Split main socket var into ses.sock_in/ses.sock_out in preparation
for -J proxy_cmd option (and some prelim options for that)

--HG--
extra : convert_revision : 47cdea9a7d66c553c6f5eec43b899821939d4e4c
2008-09-15 12:51:50 +00:00
Matt Johnston
75ec4d6510 - Add -K keepalive flag for dropbear and dbclient
- Try to reduce the frequency of select() timeouts
- Add a max receive window size of 1MB

--HG--
extra : convert_revision : 9aa22036cb511cddb35fbc0e09ad05acb39b64d1
2007-08-08 15:12:06 +00:00
Matt Johnston
57ae0bfedf Prevent invalid packets being sent during key-exchange, instead queue
them until afterwards. This could sometimes terminate connections
after 8 hours if (for example) a new TCP forwarded connection
was sent at the KEX timeout.

--HG--
extra : convert_revision : 48426bd66b8f5ba50045f7ba190d1672745132e2
2007-07-27 17:13:42 +00:00
Matt Johnston
2d4d9627a2 Rearrange the channel buffer sizes into three neat use-editable values in
options.h. Increasing RECV_MAX_WINDOW gives big network performance
increases - even with the present buffers (which haven't changed) it
performs a lot better.
Next step is to make the window size a cmdline option.

--HG--
extra : convert_revision : 24c7cb47fb56cf5b82e3bc0859b45ea83038eab0
2007-07-24 15:40:23 +00:00
Matt Johnston
f5ad5c1553 Improve behaviour when flushing out after a process has exited.
--HG--
branch : channel-fix
extra : convert_revision : e73ee8f7ae404a9355685c30828a0ad4524031bc
2007-02-09 10:43:16 +00:00
Matt Johnston
dd06653e53 Tidy up behaviour when select() is interrupted. We follow normal
codepaths, just with no FDs set.

--HG--
branch : channel-fix
extra : convert_revision : d348546b80847bc0d42a7b5208bb31a54f1fdfaf
2006-12-05 13:27:59 +00:00
Matt Johnston
afb651821b Just use the normal "remote closed" handler when reading ident stings
--HG--
extra : convert_revision : 9a4e042fd565f46141e81e0c1ab90260303348fe
2006-07-27 01:24:39 +00:00
Matt Johnston
b598996497 Exit with a message if the ssh protocol version is incompatible
--HG--
extra : convert_revision : 5d396842815593611f0d61762440145d1fc74d5a
2006-03-04 08:22:16 +00:00
Matt Johnston
70438b7715 merge of da30137eaac417f50a323f9ddd29999ec21261e0
and fb45ddf51e20f0ff007eb8abc737de3c024f45cc

--HG--
extra : convert_revision : 2b620b0819e95e4181aa50b645a94e3a7f4d4840
2005-09-05 15:16:52 +00:00
Matt Johnston
53681cbdb6 * use own assertions which should get logged properly
--HG--
extra : convert_revision : 3dc365619f0840ab5781660b1257a9f22c05d3fe
2005-09-05 15:16:10 +00:00
Matt Johnston
e7f579b75d common session initialiser doesn't need to call
chansessioninnitialise(), fix up header definition

--HG--
extra : convert_revision : 580bc5e6e1413daf46156a181259c244ce1ab174
2005-09-05 12:13:44 +00:00
Matt Johnston
8c1a429c44 Fixed DEBUG_TRACE macro so that we don't get semicolons left about the place
--HG--
extra : convert_revision : d928bc851e32be7bd429bf7504b148c0e4bf7e2f
2005-01-02 20:25:56 +00:00
Matt Johnston
96823c424d Initialise the outgoing packet queue
--HG--
extra : convert_revision : d9981dbae7bf47d3bd6d1bcf4e602e7bf682082f
2004-11-03 13:47:44 +00:00
Matt Johnston
51a74b4799 - added circular buffering for channels
- added stderr support for the client
- cleaned up a bunch of "unused" warnings, duplicated header definitions
- added exit-status support for the client

--HG--
extra : convert_revision : 5bdf806d8b440c87f7235414662f4189195618f4
2004-08-26 13:16:40 +00:00
Matt Johnston
2dcd6b22d9 Nasty.
--HG--
extra : convert_revision : e1229cd01c3007206d2937ea390ad4966c289a5a
2004-08-24 18:12:18 +00:00
Matt Johnston
d254e0191d Allow leading lines before the ident banner when connecting
--HG--
extra : convert_revision : ae4b1bdb29e60927c032674800f0258fc5966807
2004-08-24 04:10:37 +00:00
Matt Johnston
55c9b45649 added window-size change handling
--HG--
extra : convert_revision : 93a39c7b76f478035046b9c6f88af54612cce36f
2004-08-01 09:41:37 +00:00
Matt Johnston
2d82f73484 Client mostly works up to password auth
Need to rework algo-choosing etc, since server is now broken.

--HG--
extra : convert_revision : 458dc4eed0e885e7c91633d4781d3348213a0e19
2004-07-28 16:44:16 +00:00