[PATCH] Support running test/test_aslr.py without venv

2022-04-01 Thread Guilhem Moulin
Hi Matt,

Congrats for the new release! :-)  The compile-time tests are especially
welcome, even though unfortunately we can't enable them for Debian
packages since writing into ~/.ssh within build environments is
forbidden by Policy.  But instead we can run the pytest command as an
autopkgtest with the adequate Restriction field.

Since these tests are self contained we can't use virtualenv, and
without it pytest fails due a shell parsing error similar to

$ ; echo nay
bash: syntax error near unexpected token `;'

The fix is trivial.  Please consider applying
https://salsa.debian.org/debian/dropbear/-/blob/debian/latest/debian/patches/support-running-test_aslr-without-venv.patch
which I'm also attaching to this mail for convenience.

Thanks,
cheers
-- 
Guilhem.
From: Guilhem Moulin 
Date: Fri, 1 Apr 2022 23:27:50 +0200
Subject: Support running test_aslr without venv.

Without this patch the test fails because the remote shell can't parse
the command:

$ ; echo nay
bash: syntax error near unexpected token `;'
---
 test/test_aslr.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/test_aslr.py b/test/test_aslr.py
index ec38844..b2fa272 100644
--- a/test/test_aslr.py
+++ b/test/test_aslr.py
@@ -9,9 +9,12 @@ def test_reexec(request, dropbear):
 	This indicates that re-exec makes ASLR work
 	"""
 	map_script = (Path(request.node.fspath).parent / "parent_dropbear_map.py").resolve()
-	# run within the same venv, for python deps
 	activate = own_venv_command()
-	cmd = f"{activate}; {map_script}"
+	if activate == "":
+		cmd = map_script
+	else:
+		# run within the same venv, for python deps
+		cmd = f"{activate}; {map_script}"
 	print(cmd)
 	r = dbclient(request, cmd, capture_output=True, text=True)
 	map1 = r.stdout.rstrip()


signature.asc
Description: PGP signature


Dropbear 2022.82

2022-04-01 Thread Matt Johnston
Hi all,

Dropbear 2022.82 is released at last, with various
improvements and some relatively minor fixes. Thanks to
everyone who provided code, bug reports, suggestions and
other help. 

Releases can be downloaded from
https://matt.ucc.asn.au/dropbear/dropbear.html

It looks like the Dropbear Mercurial repository
(hg.ucc.asn.au) isn't getting used much any more. Perhaps it
is finally time to move the canonical source to git/github.
If anyone is still using the Mercurial repo please let me
know. 

Cheers,
Matt

2022.82 - 1 April 2022

Features and Changes:
  Note >> for compatibility/configuration changes

- Implemented OpenSSH format private key handling for dropbearconvert.
  Keys can be read in OpenSSH format or the old PEM format.
  >> Keys are now written in OpenSSH format rather than PEM.
  ED25519 support is now correct. DSS keys are still PEM format.

- Use SHA256 for key fingerprints

- >> Reworked -v verbose printing, specifying multiple times will increase
  verbosity. - is equivalent to the old DEBUG_TRACE -v level, it
  can be configured at compile time in localoptions.h (see default_options.h)
  Lower -v options can be used to check connection progress or algorithm
  negotiation.
  Thanks to Hans Harder for the implementation

  localoptions.h DEBUG_TRACE should be set to 4 for the same result as the
  previous DEBUG_TRACE 1.

- Added server support for U2F/FIDO keys (ecdsa-sk and ed25519-sk) in
  authorized_keys. no-touch-required option isn't allowed yet.
  Thanks to Egor Duda for the implementation

- autoconf output (configure script etc) is now committed to version control.
  >> It isn't necessary to run "autoconf" any more on a checkout.

- sha1 will be omitted from the build if KEX/signing/MAC algorithms don't
  require it. Instead sha256 is used for random number generation.
  See sysoptions.h to see which algorithms require which hashes.

- Set SSH_PUBKEYINFO environment variable based on the authorized_keys
  entry used for auth. The first word of the comment after the key is used
  (must only have characters a-z A-Z 0-9 .,_-+@)
  Patch from Hans Harder, modified by Matt Johnston

- Let dbclient multihop mode be used with '-J'.
  Patch from Hans Harder

- Allow home-directory relative paths ~/path for various settings
  and command line options.
  *_PRIV_FILENAME DROPBEAR_PIDFILE SFTPSERVER_PATH MOTD_FILENAME
  Thanks to Begley Brothers Inc

  >> The default DROPBEAR_DEFAULT_CLI_AUTHKEY has now changed, it now needs
  a tilde prefix.

- LANG environment variable is carried over from the Dropbear server process
  From Maxim Kochetkov

- Add /usr/sbin and /sbin to $PATH when logging in as root.
  Patch from Raphaƫl Hertzog
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903403

- Added client option "-o DisableTrivialAuth". This can be used to prevent
  the server immediately accepting successful authentication (before any auth
  request) which could cause UI confusion and security issues with agent
  forwarding - it isn't clear which host is prompting to use a key.
  Thanks to Manfred Kaiser from Austrian MilCERT

- Add -q client option to hide remote banner, from Hans Harder

- Add -e option to pass all server environment variables to child processes.
  This should be used with caution.
  Patch from Roland Vollgraf (github #118)

- >> Use DSCP for QoS traffic classes. Priority (tty) traffic is now set to
  AF21 "interactive". Previously TOS classes were used, they are not used by
  modern traffic classifiers. Non-tty traffic is left at default priority.

- >> Disable dh-group1 key exchange by default. It has been disabled server
  side by default since 2018.

- >> Removed Twofish cipher

- Dropbear now re-executes itself rather than just forking for each connection
  (only on Linux). This allows ASLR to randomise address space for each
  connection as a security mitigation. It should not have any visible impact
  - if there are any performance impacts in the wild please report it.

Fixes:

- Fix flushing channel data when pty was allocated (github #85)
  Data wasn't completely transmitted at channel close.
  Reported and initial patch thanks to Yousong Zhou

- Check authorized_keys permissions as the user, fixes NFS squash root.
  Patch from Chris Dragan (github #107)

- A missing home directory is now non-fatal, starting in / instead

- Fixed IPv6 [address]:port parsing for dbclient -b
  Reported by Fabio Molinari

- Improve error logging so that they are logged on the server rather than being
  sent to the client over the connection

- Max window size is increased to 10MB, more graceful fallback if it's invalid.

- Fix correctness of Dropbear's handling of global requests.
  Patch from Dirkjan Bussink

- Fix some small bugs found by fuzzers, null pointer dereference crash and leaks
  (post authentication)

- $HOME variable is used before /etc/passwd when expanding paths such as
  ~/.ssh/id_dropbear (for the client). Patch from Matt Robinson

- C89 build fixes from