Tue Sep 29 15:17:42 2020 UTC ()
openssh: Update to 8.4.1

Changelog:
Future deprecation notice
=========================

It is now possible[1] to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K. For this reason, we will be
disabling the "ssh-rsa" public key signature algorithm by default in a
near-future release.

This algorithm is unfortunately still used widely despite the
existence of better alternatives, being the only remaining public key
signature algorithm specified by the original SSH RFCs.

The better alternatives include:

 * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These
   algorithms have the advantage of using the same key type as
   "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been
   supported since OpenSSH 7.2 and are already used by default if the
   client and server support them.

 * The ssh-ed25519 signature algorithm. It has been supported in
   OpenSSH since release 6.5.

 * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These
   have been supported by OpenSSH since release 5.7.

To check whether a server is using the weak ssh-rsa public key
algorithm, for host authentication, try to connect to it after
removing the ssh-rsa algorithm from ssh(1)'s allowed list:

    ssh -oHostKeyAlgorithms=-ssh-rsa user@host

If the host key verification fails and no other supported host key
types are available, the server software on that host should be
upgraded.

We intend to enable UpdateHostKeys by default in the next OpenSSH
release. This will assist the client by automatically migrating to
better algorithms. Users may consider enabling this option manually.

[1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and
    Application to the PGP Web of Trust" Leurent, G and Peyrin, T
    (2020) https://eprint.iacr.org/2020/014.pdf

Security
========

 * ssh-agent(1): restrict ssh-agent from signing web challenges for
   FIDO/U2F keys.

   When signing messages in ssh-agent using a FIDO key that has an
   application string that does not start with "ssh:", ensure that the
   message being signed is one of the forms expected for the SSH protocol
   (currently public key authentication and sshsig signatures).

   This prevents ssh-agent forwarding on a host that has FIDO keys
   attached granting the ability for the remote side to sign challenges
   for web authentication using those keys too.

   Note that the converse case of web browsers signing SSH challenges is
   already precluded because no web RP can have the "ssh:" prefix in the
   application string that we require.

 * ssh-keygen(1): Enable FIDO 2.1 credProtect extension when generating
   a FIDO resident key.

   The recent FIDO 2.1 Client to Authenticator Protocol introduced a
   "credProtect" feature to better protect resident keys. We use this
   option to require a PIN prior to all operations that may retrieve
   a resident key from a FIDO token.

Potentially-incompatible changes
================================

This release includes a number of changes that may affect existing
configurations:

 * For FIDO/U2F support, OpenSSH recommends the use of libfido2 1.5.0
   or greater. Older libraries have limited support at the expense of
   disabling particular features. These include resident keys, PIN-
   required keys and multiple attached tokens.

 * ssh-keygen(1): the format of the attestation information optionally
   recorded when a FIDO key is generated has changed. It now includes
   the authenticator data needed to validate attestation signatures.

 * The API between OpenSSH and the FIDO token middleware has changed
   and the SSH_SK_VERSION_MAJOR version has been incremented as a
   result. Third-party middleware libraries must support the current
   API version (7) to work with OpenSSH 8.4.

 * The portable OpenSSH distribution now requires automake to rebuild
   the configure script and supporting files. This is not required when
   simply building portable OpenSSH from a release tar file.

Changes since OpenSSH 8.3
=========================

New features
------------

 * ssh(1), ssh-keygen(1): support for FIDO keys that require a PIN for
   each use. These keys may be generated using ssh-keygen using a new
   "verify-required" option. When a PIN-required key is used, the user
   will be prompted for a PIN to complete the signature operation.

 * sshd(8): authorized_keys now supports a new "verify-required"
   option to require FIDO signatures assert that the token verified
   that the user was present before making the signature. The FIDO
   protocol supports multiple methods for user-verification, but
   currently OpenSSH only supports PIN verification.

 * sshd(8), ssh-keygen(1): add support for verifying FIDO webauthn
   signatures. Webauthn is a standard for using FIDO keys in web
   browsers. These signatures are a slightly different format to plain
   FIDO signatures and thus require explicit support.

 * ssh(1): allow some keywords to expand shell-style ${ENV}
   environment variables. The supported keywords are CertificateFile,
   ControlPath, IdentityAgent and IdentityFile, plus LocalForward and
   RemoteForward when used for Unix domain socket paths. bz#3140

 * ssh(1), ssh-agent(1): allow some additional control over the use of
   ssh-askpass via a new $SSH_ASKPASS_REQUIRE environment variable,
   including forcibly enabling and disabling its use. bz#69

 * ssh(1): allow ssh_config(5)'s AddKeysToAgent keyword accept a time
   limit for keys in addition to its current flag options. Time-
   limited keys will automatically be removed from ssh-agent after
   their expiry time has passed.

 * scp(1), sftp(1): allow the -A flag to explicitly enable agent
   forwarding in scp and sftp. The default remains to not forward an
   agent, even when ssh_config enables it.

 * ssh(1): add a '%k' TOKEN that expands to the effective HostKey of
   the destination. This allows, e.g., keeping host keys in individual
   files using "UserKnownHostsFile ~/.ssh/known_hosts.d/%k". bz#1654

 * ssh(1): add %-TOKEN, environment variable and tilde expansion to
   the UserKnownHostsFile directive, allowing the path to be
   completed by the configuration (e.g. bz#1654)

 * ssh-keygen(1): allow "ssh-add -d -" to read keys to be deleted
   from stdin. bz#3180

 * sshd(8): improve logging for MaxStartups connection throttling.
   sshd will now log when it starts and stops throttling and periodically
   while in this state. bz#3055

Bugfixes
--------

 * ssh(1), ssh-keygen(1): better support for multiple attached FIDO
   tokens. In cases where OpenSSH cannot unambiguously determine which
   token to direct a request to, the user is now required to select a
   token by touching it. In cases of operations that require a PIN to
   be verified, this avoids sending the wrong PIN to the wrong token
   and incrementing the token's PIN failure counter (tokens
   effectively erase their keys after too many PIN failures).

 * sshd(8): fix Include before Match in sshd_config; bz#3122

 * ssh(1): close stdin/out/error when forking after authentication
   completes ("ssh -f ...") bz#3137

 * ssh(1), sshd(8): limit the amount of channel input data buffered,
   avoiding peers that advertise large windows but are slow to read
   from causing high memory consumption.

 * ssh-agent(1): handle multiple requests sent in a single write() to
   the agent.

 * sshd(8): allow sshd_config longer than 256k

 * sshd(8): avoid spurious "Unable to load host key" message when sshd
   load a private key but no public counterpart

 * ssh(1): prefer the default hostkey algorithm list whenever we have
   a hostkey that matches its best-preference algorithm.

 * sshd(1): when ordering the hostkey algorithms to request from a
   server, prefer certificate types if the known_hosts files contain a key
   marked as a @cert-authority; bz#3157

 * ssh(1): perform host key fingerprint comparisons for the "Are you
   sure you want to continue connecting (yes/no/[fingerprint])?"
   prompt with case sensitivity.

 * sshd(8): ensure that address/masklen mismatches in sshd_config
   yield fatal errors at daemon start time rather than later when
   they are evaluated.

 * ssh-keygen(1): ensure that certificate extensions are lexically
   sorted. Previously if the user specified a custom extension then
   the everything would be in order except the custom ones. bz#3198

 * ssh(1): also compare username when checking for JumpHost loops.
   bz#3057

 * ssh-keygen(1): preserve group/world read permission on known_hosts
   files across runs of "ssh-keygen -Rf /path". The old behaviour was
   to remove all rights for group/other. bz#3146

 * ssh-keygen(1): Mention the [-a rounds] flag in the ssh-keygen
   manual page and usage().

 * sshd(8): explicitly construct path to ~/.ssh/rc rather than
   relying on it being relative to the current directory, so that it
   can still be found if the shell startup changes its directory.
   bz#3185

 * sshd(8): when redirecting sshd's log output to a file, undo this
   redirection after the session child process is forked(). Fixes
   missing log messages when using this feature under some
   circumstances.

 * sshd(8): start ClientAliveInterval bookkeeping before first pass
   through select() loop; fixed theoretical case where busy sshd may
   ignore timeouts from client.

 * ssh(1): only reset the ServerAliveInterval check when we receive
   traffic from the server and ignore traffic from a port forwarding
   client, preventing a client from keeping a connection alive when
   it should be terminated. bz#2265

 * ssh-keygen(1): avoid spurious error message when ssh-keygen
   creates files outside ~/.ssh

 * sftp-client(1): fix off-by-one error that caused sftp downloads to
   make one more concurrent request that desired. This prevented using
   sftp(1) in unpipelined request/response mode, which is useful when
   debugging. bz#3054

 * ssh(1), sshd(8): handle EINTR in waitfd() and timeout_connect()
   helpers. bz#3071

 * ssh(1), ssh-keygen(1): defer creation of ~/.ssh until we attempt to
   write to it so we don't leave an empty .ssh directory when it's not
   needed. bz#3156

 * ssh(1), sshd(8): fix multiplier when parsing time specifications
   when handling seconds after other units. bz#3171

Portability
-----------

 * sshd(8): always send any PAM account messages. If the PAM account
   stack returns any messages, always send them to the user and not
   just if the check succeeds. bz#2049

 * Implement some backwards compatibility for libfido2 libraries
   older than 1.5.0. Note that use of an older library will result
   in the loss of certain features including resident key support,
   PIN support and support for multiple attached tokens.

 * configure fixes for XCode 12

 * gnome-ssh-askpass3: ensure the "close" button is not focused by
   default for SSH_ASKPASS_PROMPT=none prompts. Avoids space/enter
   accidentally dismissing FIDO touch notifications.

 * gnome-ssh-askpass3: allow some control over textarea colour via
   $GNOME_SSH_ASKPASS_FG_COLOR and $GNOME_SSH_ASKPASS_BG_COLOR
   environment variables.

 * sshd(8): document another PAM spec problem in a frustrated comment

 * sshd(8): support NetBSD's utmpx.ut_ss address field. bz#960

 * Add the ssh-sk-helper binary and its manpage to the RPM spec file

 * Detect the Frankenstein monster of Linux/X32 and allow the sandbox
   to function there. bz#3085


(ryoon)
diff -r1.267 -r1.268 pkgsrc/security/openssh/Makefile
diff -r1.110 -r1.111 pkgsrc/security/openssh/distinfo
diff -r1.4 -r1.5 pkgsrc/security/openssh/patches/patch-openbsd-compat_port-tun.c
diff -r1.1 -r1.2 pkgsrc/security/openssh/patches/patch-sshkey.h

cvs diff -r1.267 -r1.268 pkgsrc/security/openssh/Makefile (expand / switch to unified diff)

--- pkgsrc/security/openssh/Makefile 2020/08/31 18:11:09 1.267
+++ pkgsrc/security/openssh/Makefile 2020/09/29 15:17:42 1.268
@@ -1,18 +1,17 @@ @@ -1,18 +1,17 @@
1# $NetBSD: Makefile,v 1.267 2020/08/31 18:11:09 wiz Exp $ 1# $NetBSD: Makefile,v 1.268 2020/09/29 15:17:42 ryoon Exp $
2 2
3DISTNAME= openssh-8.3p1 3DISTNAME= openssh-8.4p1
4PKGNAME= ${DISTNAME:S/p1/.1/} 4PKGNAME= ${DISTNAME:S/p1/.1/}
5PKGREVISION= 1 
6CATEGORIES= security 5CATEGORIES= security
7MASTER_SITES= ${MASTER_SITE_OPENBSD:=OpenSSH/portable/} 6MASTER_SITES= ${MASTER_SITE_OPENBSD:=OpenSSH/portable/}
8 7
9MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.openssh.com/ 9HOMEPAGE= https://www.openssh.com/
11COMMENT= Open Source Secure shell client and server (remote login program) 10COMMENT= Open Source Secure shell client and server (remote login program)
12LICENSE= modified-bsd 11LICENSE= modified-bsd
13 12
14CONFLICTS= sftp-[0-9]* 13CONFLICTS= sftp-[0-9]*
15CONFLICTS+= ssh-[0-9]* ssh6-[0-9]* 14CONFLICTS+= ssh-[0-9]* ssh6-[0-9]*
16CONFLICTS+= ssh2-[0-9]* ssh2-nox11-[0-9]* 15CONFLICTS+= ssh2-[0-9]* ssh2-nox11-[0-9]*
17CONFLICTS+= openssh+gssapi-[0-9]* 16CONFLICTS+= openssh+gssapi-[0-9]*
18CONFLICTS+= lsh>2.0 17CONFLICTS+= lsh>2.0

cvs diff -r1.110 -r1.111 pkgsrc/security/openssh/distinfo (expand / switch to unified diff)

--- pkgsrc/security/openssh/distinfo 2020/05/27 13:49:27 1.110
+++ pkgsrc/security/openssh/distinfo 2020/09/29 15:17:42 1.111
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1$NetBSD: distinfo,v 1.110 2020/05/27 13:49:27 sevan Exp $ 1$NetBSD: distinfo,v 1.111 2020/09/29 15:17:42 ryoon Exp $
2 2
3SHA1 (openssh-8.3p1.tar.gz) = 04c7adb9986f16746588db8988b910530c589819 3SHA1 (openssh-8.4p1.tar.gz) = 69305059e10a60693ebe6f17731f962c9577535c
4RMD160 (openssh-8.3p1.tar.gz) = 2203f2e7591ccf292dc05fccd8ea46d0fe19d88d 4RMD160 (openssh-8.4p1.tar.gz) = 2d3eec0b56f7edef5d50b8defa2f143ffee5c65a
5SHA512 (openssh-8.3p1.tar.gz) = b5232f7c85bf59ae2ff9d17b030117012e257e3b8c0d5ac60bb139a85b1fbf298b40f2e04203a2e13ca7273053ed668b9dedd54d3a67a7cb8e8e58c0228c5f40 5SHA512 (openssh-8.4p1.tar.gz) = d65275b082c46c5efe7cf3264fa6794d6e99a36d4a54b50554fc56979d6c0837381587fd5399195e1db680d2a5ad1ef0b99a180eac2b4de5637906cb7a89e9ce
6Size (openssh-8.3p1.tar.gz) = 1706358 bytes 6Size (openssh-8.4p1.tar.gz) = 1742201 bytes
7SHA1 (patch-Makefile.in) = 13502b825c13c98b2ba3b84ff4bae9aa664b76b1 7SHA1 (patch-Makefile.in) = 13502b825c13c98b2ba3b84ff4bae9aa664b76b1
8SHA1 (patch-auth.c) = 060a93f5264751769f2fdf98fefd154bd80c0c5f 8SHA1 (patch-auth.c) = 060a93f5264751769f2fdf98fefd154bd80c0c5f
9SHA1 (patch-clientloop.c) = 4e88fbd14db33f003eb93c30c682a017e102196e 9SHA1 (patch-clientloop.c) = 4e88fbd14db33f003eb93c30c682a017e102196e
10SHA1 (patch-config.h.in) = 7d1050743da7264763254b57938775c546c3baa5 10SHA1 (patch-config.h.in) = 7d1050743da7264763254b57938775c546c3baa5
11SHA1 (patch-configure.ac) = 321ef5ed83abe7e07d38026e096a10700b010ac8 11SHA1 (patch-configure.ac) = 321ef5ed83abe7e07d38026e096a10700b010ac8
12SHA1 (patch-defines.h) = bd8687a9a2857f3b8d15ae94095f27f9344003c4 12SHA1 (patch-defines.h) = bd8687a9a2857f3b8d15ae94095f27f9344003c4
13SHA1 (patch-loginrec.c) = 76f1e03182cbd18dd9ac0bdfcb6502eec7eb56a9 13SHA1 (patch-loginrec.c) = 76f1e03182cbd18dd9ac0bdfcb6502eec7eb56a9
14SHA1 (patch-openbsd-compat_openbsd-compat.h) = bedbede16ab2fe918419c994ba15a20167b411b4 14SHA1 (patch-openbsd-compat_openbsd-compat.h) = bedbede16ab2fe918419c994ba15a20167b411b4
15SHA1 (patch-openbsd-compat_port-tun.c) = 4b1b55b7fdc319e011d249ee336301b17a589228 15SHA1 (patch-openbsd-compat_port-tun.c) = b2a0ce81a52b00f106198d549b5068a5e67092ef
16SHA1 (patch-sandbox-darwin.c) = c9a1fe2e4dbf98e929d983b4206a244e0e354b75 16SHA1 (patch-sandbox-darwin.c) = c9a1fe2e4dbf98e929d983b4206a244e0e354b75
17SHA1 (patch-sshd.8) = 5bf48cd27cef8e8810b9dc7115f5180102a345d1 17SHA1 (patch-sshd.8) = 5bf48cd27cef8e8810b9dc7115f5180102a345d1
18SHA1 (patch-sshd.c) = b3674e9f467323d1852dd988a408ac23896f6700 18SHA1 (patch-sshd.c) = b3674e9f467323d1852dd988a408ac23896f6700
19SHA1 (patch-sshkey.h) = 8e6758a5f78eb48fae2df6efe8ddb9f5d4a71f7b 19SHA1 (patch-sshkey.h) = 074e9be70af58772d3172d1cb2c936000ca9a8d7

cvs diff -r1.4 -r1.5 pkgsrc/security/openssh/patches/Attic/patch-openbsd-compat_port-tun.c (expand / switch to unified diff)

--- pkgsrc/security/openssh/patches/Attic/patch-openbsd-compat_port-tun.c 2019/01/18 20:13:37 1.4
+++ pkgsrc/security/openssh/patches/Attic/patch-openbsd-compat_port-tun.c 2020/09/29 15:17:42 1.5
@@ -1,45 +1,17 @@ @@ -1,45 +1,17 @@
1$NetBSD: patch-openbsd-compat_port-tun.c,v 1.4 2019/01/18 20:13:37 tnn Exp $ 1$NetBSD: patch-openbsd-compat_port-tun.c,v 1.5 2020/09/29 15:17:42 ryoon Exp $
2 2
3if_tun.h can be found in net/tun 3if_tun.h can be found in net/tun
4 4
5--- openbsd-compat/port-net.c.orig 2018-10-17 00:01:20.000000000 +0000 5--- openbsd-compat/port-net.c.orig 2020-09-27 07:25:01.000000000 +0000
6+++ openbsd-compat/port-net.c 6+++ openbsd-compat/port-net.c
7@@ -1,3 +1,4 @@ 7@@ -135,6 +135,10 @@ sys_set_process_rdomain(const char *name
8+ 8 * System-specific tunnel open function
9 /* 9 */
10 * Copyright (c) 2005 Reyk Floeter <reyk@openbsd.org> 
11 * 
12@@ -200,6 +201,10 @@ sys_tun_open(int tun, int mode, char **i 
13 #include <sys/socket.h> 
14 #include <net/if.h> 
15  10
16+#ifdef HAVE_NET_TUN_IF_TUN_H 11+#ifdef HAVE_NET_TUN_IF_TUN_H
17+#include <net/tun/if_tun.h> 12+#include <net/tun/if_tun.h>
18+#endif 13+#endif
19+ 14+
20 #ifdef HAVE_NET_IF_TUN_H 15 #if defined(SSH_TUN_LINUX)
21 #include <net/if_tun.h> 16 #include <linux/if_tun.h>
22 #endif 17 #define TUN_CTRL_DEV "/dev/net/tun"
23@@ -209,7 +214,10 @@ sys_tun_open(int tun, int mode, char **i 
24 { 
25 struct ifreq ifr; 
26 char name[100]; 
27- int fd = -1, sock, flag; 
28+ int fd = -1, sock; 
29+#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF) 
30+ int flag; 
31+#endif 
32 const char *tunbase = "tun"; 
33  
34 if (ifname != NULL) 
35@@ -246,9 +254,9 @@ sys_tun_open(int tun, int mode, char **i 
36 return (-1); 
37 } 
38  
39+#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF) 
40 /* Turn on tunnel headers */ 
41 flag = 1; 
42-#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF) 
43 if (mode != SSH_TUNMODE_ETHERNET && 
44 ioctl(fd, TUNSIFHEAD, &flag) == -1) { 
45 debug("%s: ioctl(%d, TUNSIFHEAD, 1): %s", __func__, fd, 

cvs diff -r1.1 -r1.2 pkgsrc/security/openssh/patches/patch-sshkey.h (expand / switch to unified diff)

--- pkgsrc/security/openssh/patches/patch-sshkey.h 2019/09/06 09:03:00 1.1
+++ pkgsrc/security/openssh/patches/patch-sshkey.h 2020/09/29 15:17:42 1.2
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1$NetBSD: patch-sshkey.h,v 1.1 2019/09/06 09:03:00 manu Exp $ 1$NetBSD: patch-sshkey.h,v 1.2 2020/09/29 15:17:42 ryoon Exp $
2 2
3Support for non recommendable (insecure) modulus size for RSA. This may be 3Support for non recommendable (insecure) modulus size for RSA. This may be
4required in order to access old, non-upgradable, devices for which modulus size 4required in order to access old, non-upgradable, devices for which modulus size
5is less than 1024 bits (frequently 768 bits). 5is less than 1024 bits (frequently 768 bits).
6 6
7--- sshkey.h.orig 2019-09-03 17:55:31.695925772 +0200 7--- sshkey.h.orig 2020-09-27 07:25:01.000000000 +0000
8+++ sshkey.h 8+++ sshkey.h
9@@ -47,7 +47,11 @@ 9@@ -48,7 +48,11 @@
10 # define EC_POINT void 10 # define EC_POINT void
11 #endif /* WITH_OPENSSL */ 11 #endif /* WITH_OPENSSL */
12 12
13+#ifdef SSH_RSA_INSECURE_LEGACY_MIN_MOD_SZ 13+#ifdef SSH_RSA_INSECURE_LEGACY_MIN_MOD_SZ
14+#define SSH_RSA_MINIMUM_MODULUS_SIZE SSH_RSA_INSECURE_LEGACY_MIN_MOD_SZ 14+#define SSH_RSA_MINIMUM_MODULUS_SIZE SSH_RSA_INSECURE_LEGACY_MIN_MOD_SZ
15+#else 15+#else
16 #define SSH_RSA_MINIMUM_MODULUS_SIZE 1024 16 #define SSH_RSA_MINIMUM_MODULUS_SIZE 1024
17+#endif 17+#endif
18 #define SSH_KEY_MAX_SIGN_DATA_SIZE (1 << 20) 18 #define SSH_KEY_MAX_SIGN_DATA_SIZE (1 << 20)
19  19
20 struct sshbuf; 20 struct sshbuf;