Commit Graph

1728 Commits

Author SHA1 Message Date
Matt Johnston
ae8a0abc34 test: Set allow_reuse_addr
This avoids intermittent "Address already in use" failure
2022-03-15 15:38:46 +08:00
HansH111
488ffce133 only show banner when cli_opts.quiet is not set 2022-03-14 09:50:07 +08:00
HansH111
360d60fb34 use option -q for suppression remote banner output, pass option also for proxy command 2022-03-14 09:50:07 +08:00
HansH111
fa4a1ab435 added quiet variable in cli_opts 2022-03-14 09:50:07 +08:00
Matt Johnston
8d11116dcb Make missing homedir non-fatal, instead use /
Fixes github #146
2022-02-24 11:51:51 +08:00
Matt Johnston
26feb8f13e Handle /proc/.../maps being reordered
We now search for the first r-xp line in the file
2022-02-03 22:13:06 +08:00
Matt Johnston
9124997602 Avoid unused argument warning when reexec is unused 2022-02-03 22:12:11 +08:00
Matt Johnston
12b094f0bf Fix regression in non-symlink dropbearmulti
Introduced in recent commit for re-exec
2022-02-01 23:15:53 +08:00
Matt Johnston
5334d58a15 Fix accidentally commented out test matrix items 2022-02-01 22:25:51 +08:00
Matt Johnston
3939321750 Make re-exec work with "dropbearmulti dropbear"
The re-exec needs to know to use the dropbearmulti binary instead.
Add a test for this case.
2022-02-01 22:19:49 +08:00
Matt Johnston
a95ca34a10 Fix incorrect algolist TRACE print 2022-02-01 22:12:25 +08:00
Matt Johnston
4c2d2fc3ac merge 2022-02-01 15:51:01 +08:00
Matt Johnston
e93b03cb00 Fix missing NULL terminator for re-exec
Also fixes fallback, sockets were not kept open
2022-01-31 11:12:58 +08:00
Matt Johnston
2b0238706a Add test for up-to-date configure script 2022-01-30 14:15:37 +08:00
Matt Johnston
3fb2406717 Fix testing with dropbearmulti 2022-01-30 13:46:52 +08:00
Matt Johnston
d367503fb0 Remove extraneous print 2022-01-30 13:46:20 +08:00
Matt Johnston
2a6dac19b5 Use venv for test_aslr
Otherwise we can't find the psutil dependency
2022-01-30 13:37:20 +08:00
Matt Johnston
da7f77a50d Fix -Wexpansion-to-defined failure on clang
(failure introduced in previous re-exec commit)
2022-01-30 10:23:06 +08:00
Matt Johnston
c7b7c9a99d Add re-exec for server
This allows ASLR to re-randomize the address
space for every connection, preventing some
vulnerabilities from being exploitable by
repeated probing.

Overhead (memory and time) is yet to be confirmed.

At present this is only enabled on Linux. Other BSD platforms
with fexecve() would probably also work though have not been tested.
2022-01-30 10:14:56 +08:00
Matt Johnston
ebb4018889 Merge netio changes 2022-01-27 15:09:29 +08:00
Matt Johnston
1c8f00bd59 Leave non-interactive at default QoS class
Lower class levels are less well defined, and non-interactive
SSH can carry various different types of applications.

This change also sets lowdelay class (AF21) earlier in an an outbound
dbclient session
2022-01-27 14:34:10 +08:00
Matt Johnston
a4362d3019 Test for IP_TOS and hardcode DSCP values
This allows it to work on macos too
2022-01-25 17:57:05 +08:00
Matt Johnston
14bdd5a8ae Use DSCP for IP QoS traffic classes
The previous TOS values are deprecated and not used by modern traffic
classifiers. This sets AF21 for "interactive" traffic (with a tty).
Non-tty traffic sets AF11 - that indicates high throughput but is not
lowest priority (which would be CS1 or LE).

This differs from the CS1 used by OpenSSH, it lets interactive git over SSH
have higher priority than background least effort traffic. Dropbear's settings
here should be suitable with the diffservs used by CAKE qdisc.
2022-01-25 17:32:20 +08:00
Matt Johnston
f3a4ea511b Use DSCP for IP QoS traffic classes
The previous TOS values are deprecated and not used by modern traffic
classifiers. This sets AF21 for "interactive" traffic (with a tty).
Non-tty traffic sets AF11 - that indicates high throughput but is not
lowest priority (which would be CS1 or LE).

This differs from the CS1 used by OpenSSH, it lets interactive git over SSH
have higher priority than background least effort traffic. Dropbear's settings
here should be suitable with the diffservs used by CAKE qdisc.
2022-01-25 17:32:20 +08:00
Matt Johnston
f972813ecd Don't include sk keys at all in KEX list 2022-01-23 17:29:39 +08:00
Matt Johnston
8727f49dec Don't include sk keys at all in KEX list 2022-01-23 17:29:39 +08:00
egor-duda
5edd2ce32e
Implement server-side support for sk-ecdsa U2F-backed keys (#142)
* Implement server-side support for sk-ecdsa U2F-backed keys

* Fix out-of-bounds read on normal ecdsa-sha2-[identifier] keys

* Fix one more potential out-of-bounds read

* Check if nistp256 curve is used in sk-ecdsa-sha2- key

It's the only allowed curve per PROTOCOL.u2f specification

* Implement server-side support for sk-ed25519 FIDO2-backed keys

* Keys with type sk-* make no sense as host keys, so they should be
disabled

* fix typo

* Make sk-ecdsa call buf_ecdsa_verify

This reduces code duplication, the SK code just handles the
different message format.

* Reduce sk specific code

The application id can be stored in signkey, then we don't need
to call sk-specific functions from svr-authpubkey

* Remove debugging output, which causes compilation errors with DEBUG_TRACE disabled

* Proper cleanup of sk_app

Co-authored-by: Matt Johnston <matt@codeconstruct.com.au>
2022-01-22 21:53:04 +08:00
egor-duda
c06d8254d8 Implement server-side support for sk-ecdsa U2F-backed keys (#142)
* Implement server-side support for sk-ecdsa U2F-backed keys

* Fix out-of-bounds read on normal ecdsa-sha2-[identifier] keys

* Fix one more potential out-of-bounds read

* Check if nistp256 curve is used in sk-ecdsa-sha2- key

It's the only allowed curve per PROTOCOL.u2f specification

* Implement server-side support for sk-ed25519 FIDO2-backed keys

* Keys with type sk-* make no sense as host keys, so they should be
disabled

* fix typo

* Make sk-ecdsa call buf_ecdsa_verify

This reduces code duplication, the SK code just handles the
different message format.

* Reduce sk specific code

The application id can be stored in signkey, then we don't need
to call sk-specific functions from svr-authpubkey

* Remove debugging output, which causes compilation errors with DEBUG_TRACE disabled

* Proper cleanup of sk_app

Co-authored-by: Matt Johnston <matt@codeconstruct.com.au>
2022-01-22 21:53:04 +08:00
Matt Johnston
18be2a6509 Fix accidentally committed debug message
Was added Oct 18 2021
"Only redirect stderr after the session login."
2022-01-22 12:46:08 +08:00
Matt Johnston
483b427335 debugging test runner authorized_keys perms 2021-10-19 13:45:59 +08:00
Matt Johnston
27ffea3223 Debug pytest password auth failing 2021-10-19 13:30:58 +08:00
Matt Robinson
742e296115
Use HOME before /etc/passwd to find id_dropbear (#137)
Currently dbclient uses the value of HOME by default when looking for
~/.ssh/known_hosts, falling back to /etc/passwd if HOME is not set (so
that people can work around broken values in /etc/passwd).

However, when locating the default authentication key (defaults to
~/.ssh/id_dropbear), paths not starting with / are always prefixed with
the value from /etc/passwd.

Make the behaviour consistent by adjusting expand_homedir_path to use
the value of HOME, falling back to /etc/passwd if HOME is not set.
2021-10-19 13:02:47 +08:00
Matt Johnston
0e43d68d81 Remove caching and socat from build.yml
socat isn't needed and it consumes exit codes

Caching seems impossible to invalidate
2021-10-19 12:49:19 +08:00
Matt Johnston
bcb9d78d83 Add configure --enable-werror argument
This should be used instead of putting -Werror in CFLAGS
before configure, as -Werror interferes with conftests.

Update github actions to use that.
2021-10-19 12:16:20 +08:00
Matt Johnston
8da9646c83 Upload config.log on failure
Change tests to avoid double-negative for skipcheck

Skip some actions when running under act
2021-10-19 11:50:12 +08:00
Matt Johnston
da482ede60 github action workaround macos ranlib 2021-10-18 23:45:09 +08:00
Matt Johnston
f0495697e5 disable fuzzstandalone github action for now, needs debugging 2021-10-18 23:36:23 +08:00
Matt Johnston
f9ced2c880 fix github actions arguments
If only we could test this locally with the same setup....
2021-10-18 23:33:41 +08:00
Matt Johnston
17e0c7e76f github action, don't try apt or python on macos 2021-10-18 23:31:23 +08:00
Matt Johnston
30adc15860 Use sudo for the real github action job
(Wasn't required by act's runner)
2021-10-18 23:25:20 +08:00
Matt Johnston
6138bdc62f Add github actions build workflow, remove travis CI 2021-10-18 23:21:52 +08:00
Matt Johnston
e05945f67a Add a default 10 second timeout for tests 2021-10-18 23:20:32 +08:00
Matt Johnston
3e640acd17 Only redirect stderr after the session login. That lets errors
get recorded on the server parent side, rather than being sent
over a SSH connection.
2021-10-18 23:20:08 +08:00
Matt Johnston
ae25761c7c Rename "make test" to "make check". Also run lint 2021-10-18 15:17:14 +08:00
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