Commit Graph

1684 Commits

Author SHA1 Message Date
Matt Johnston
e6152ccd7d Update .hgignore and .gitignore with tests 2021-10-18 14:26:59 +08:00
Matt Johnston
8b0d31ab20 Add "make test" target to run pytest
This will create a virtualenv if required.

There is a bit of churn here reverting to autoconf 2.59 in generated
config.h.in and configure
2021-10-18 14:24:32 +08:00
Matt Johnston
65f6e48a06 Add first channel tests
These initial tests are checking various edge cases of channel handling
that have cropped up over the years.
2021-10-18 14:22:37 +08:00
Matt Johnston
a7ef149463 Bring back recently removed channel->flushing
This resolves the "sleep 10&echo hello" case which should
return immediately
2021-10-14 20:55:15 +08:00
Matt Johnston
043b0fbd1b Increase max window size to 10MB, fallback rather than
exiting if an invalid value is given.
2021-10-12 23:32:10 +08:00
Matt Johnston
110b55214b Partial strings from strtoul should return error 2021-10-12 23:31:09 +08:00
Matt Johnston
c08177a3af Banner size should account for newlines 2021-10-12 21:29:42 +08:00
Matt Johnston
3c2436cd05 Comment on reason for DROPBEAR_MAX_PASSWORD_LEN limit 2021-10-12 21:29:25 +08:00
Matt Johnston
f3b72bfd18 Merge 2021-10-11 15:46:49 +08:00
Matt Johnston
f17400e738 Replace ChanType.sepfds with Channel.bidir_fd
This handles the case where a svrchansess has separate FDs
for nopty, but a single FD for pty mode.

The use of sepfds was also previously incorrect for X11 and
agent forwarding
2021-10-11 15:42:14 +08:00
Matt Johnston
8e6f73e879 - Remove "flushing" handling for exited processes, it should be
handled by normal file descriptor reads.

- Fix sesscheckclose() handling if a channel was closed before a
  process was ever launched
2021-10-11 15:16:54 +08:00
Matt Johnston
7c2470ba3a Fix some outdated comments 2021-10-11 15:14:46 +08:00
Matt Johnston
cc59c08605 Move comment to svr_chansess_checksignal() where it belongs 2021-10-11 15:13:42 +08:00
Matt Johnston
661d8ca225 Add a comment about sending initial auth request 2021-10-11 15:12:22 +08:00
fidomax
41d4b4e7f7
keep LANG env variable for child process (#111) 2021-08-19 23:49:52 +08:00
Anton Bershanskiy
dc016f900b
Remove unused argument of do_cmd() in scp.c (#125) 2021-08-19 23:40:58 +08:00
Sven Roederer
4c8c879b38
signkey: remove !! from SHA1 digest (#130)
Remove the "!!" chars from message when printing the key-fingerprint, as it's
confusing users. They have been added when switching from MD5, but SHA1 can be
considered as standard today.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-08-19 23:39:31 +08:00
Manfred Kaiser
210a983349
added option to disable trivial auth methods (#128)
* added option to disable trivial auth methods

* rename argument to match with other ssh clients

* fixed trivial auth detection for pubkeys
2021-08-19 23:37:14 +08:00
Matt Johnston
69e5709f75 Clarify help text for dropbear -e environment option 2021-08-19 23:17:34 +08:00
Roland Vollgraf
2157d52352
pass on sever process environment to child processes (option -e) (#118) 2021-08-19 23:13:41 +08:00
Matt Johnston
846d38fe43 Add "restrict" authorized_keys option 2021-05-01 20:47:15 +08:00
Matt Johnston
a8d6dac2c5 Don't include .hg_archival.txt in tarballs. They're now reproducible. 2021-03-31 23:31:26 +08:00
Matt Johnston
ee49a1b16d merge 2021-03-31 23:24:55 +08:00
Matt Johnston
325d0c1d02 Add configure script to version control. Set timezone for release tarball 2021-03-31 23:23:14 +08:00
Matt Johnston
17f209f9b7 Update config.sub and config.guess to latest 2021-03-31 23:21:30 +08:00
Matt Johnston
924d5a06a6 Make releases tarballs more deterministic
Not fully tested on different systems yet
2021-03-30 22:08:14 +08:00
Matt Johnston
1bf7acc5bd Remove some obselete autoconf bits.
Keeps autoconf 2.71 happy, though we leave the prereq version at 2.59
2021-03-30 20:42:04 +08:00
ValdikSS
8d0013bbe0
Use MAX_HOST_LEN for TCP forwarding requests (#121)
tcpip-forward request can include hostname, which is later resolved by getaddrinfo() call.
Dropbear incorrectly assumes tcpip-forward includes only IP(v4) address. Fix this.
2021-03-18 21:16:17 +08:00
Matt Johnston
9262ffe861 fuzz: don't push wrapfd descriptors larger than needed 2021-03-08 21:59:10 +08:00
Matt Johnston
1eb369272b fuzz: add -q quiet argument for standalone fuzzers.
travis has a log length limit
2021-03-07 21:26:34 +08:00
Matt Johnston
c0ed29ea02 fuzz: split long argument list with xargs 2021-03-07 16:30:33 +08:00
Matt Johnston
91ca561d7a fuzz: cifuzz fix syntax 2021-03-06 23:44:16 +08:00
Matt Johnston
ba260bd67b fuzz: try run cifuzz on push as well 2021-03-06 23:42:59 +08:00
Matt Johnston
898bff3d4e fuzz: add cifuzz for github pull requests 2021-03-06 23:34:39 +08:00
Matt Johnston
67a8de30b7 Prevent multiple shells being spawned
Existing shells would be leaked.
The old check only caught multiple commands, not shells.
2021-03-06 23:06:43 +08:00
Matt Johnston
6c571c54e5 small tidy of "signal" while loop 2021-03-06 23:05:17 +08:00
Matt Johnston
d2bfa6aedc fuzz: handle errors from wrapfd_new_dummy() 2021-03-06 22:58:57 +08:00
Matt Johnston
d0d1ede191 fuzz: fix crash in newtcpdirect(), don't close the channel too early 2021-03-05 22:51:11 +08:00
Matt Johnston
3c2f113a78 Return errstring on connect failure 2021-03-05 21:13:20 +08:00
Matt Johnston
f193e95a3e fuzz: avoid extraneous printing 2021-03-04 23:57:12 +08:00
Matt Johnston
03481aba06 Define _GNU_SOURCE properly, other header fixes
This lets -std=c89 build for gcc 8.4.0
2021-03-04 21:03:02 +08:00
Matt Johnston
8b0fdf8010 Small cleanups of netio allocated port 2021-03-04 21:02:16 +08:00
Guillaume Picquet
934cc87db3
Update netio.c (#115)
Moved allocated_lport_p and allocated_lport at begin of block to buld in C89
2021-03-04 20:50:13 +08:00
Guillaume Picquet
ae94f64145
Update cli-main.c (#114)
Moved pid_t proxy_cmd_pid declaration at begin of block to allow build in c89 (gcc-2.95)
2021-03-04 20:46:46 +08:00
Matt Johnston
8552a0e9eb Disable UNAUTH_CLOSE_DELAY by default 2021-03-02 22:20:14 +08:00
Matt Johnston
d20420e709 merge 2021-01-29 21:59:12 +08:00
Matt Johnston
e8640bdca3 fuzz: wrap kill() 2021-01-29 21:47:56 +08:00
Xenhat
e4edbf2e57
Update INSTALL (#113)
Make Git/Mercurial instructions easier to understand
2020-12-17 17:35:48 +08:00
Matt Johnston
5d60e5f312 Use buf_eatstring instead 2020-12-10 23:18:48 +08:00
Dirkjan Bussink
38d7da5fe5
Fix handling of replies to global requests (#112)
The current code assumes that all global requests want / need a reply.
This isn't always true and the request itself indicates if it wants a
reply or not.

It causes a specific problem with hostkeys-00@openssh.com messages.
These are sent by OpenSSH after authentication to inform the client of
potential other host keys for the host. This can be used to add a new
type of host key or to rotate host keys.

The initial information message from the server is sent as a global
request, but with want_reply set to false. This means that the server
doesn't expect an answer to this message. Instead the client needs to
send a prove request as a reply if it wants to receive proof of
ownership for the host keys.

The bug doesn't cause any current problems with due to how OpenSSH
treats receiving the failure message. It instead treats it as a
keepalive message and further ignores it.

Arguably this is a protocol violation though of Dropbear and it is only
accidental that it doesn't cause a problem with OpenSSH.

The bug was found when adding host keys support to libssh, which is more
strict protocol wise and treats the unexpected failure message an error,
also see https://gitlab.com/libssh/libssh-mirror/-/merge_requests/145
for more information.

The fix here is to honor the want_reply flag in the global request and
to only send a reply if the other side expects a reply.
2020-12-10 23:13:13 +08:00