Commit graph

1301 commits

Author SHA1 Message Date
Pierre Pronchery cf2fc1b0f5 openssl: Vendor import of OpenSSL-3.0.9
Summary:
Release notes can be found at
https://www.openssl.org/news/openssl-3.0-notes.html .

Obtained from:  https://www.openssl.org/source/openssl-3.0.10.tar.gz

Test Plan:
```
$ git status
On branch vendor/openssl-3.0
Your branch is up to date with 'origin/vendor/openssl-3.0'.

nothing to commit, working tree clean
$ (cd ..; fetch https://www.openssl.org/source/openssl-${OSSLVER}.tar.gz https://www.openssl.org/source/openssl-${OSSLVER}.tar.gz.asc)
openssl-3.0.10.tar.gz                                   14 MB   15 MBps    01s
openssl-3.0.10.tar.gz.asc                              833  B   11 MBps    00s
$ set | egrep '(XLIST|OSSLVER)='
OSSLVER=3.0.10
XLIST=FREEBSD-Xlist
$ gpg --list-keys
/home/khorben/.gnupg/pubring.kbx
--------------------------------
pub   rsa4096 2011-03-01 [SCA]
      DC34EE5DB2417BCC151E5100E5F8F8212F77A498
uid           [ unknown] Willem Toorop <willem@nlnetlabs.nl>
sub   rsa4096 2011-03-01 [E]

pub   rsa4096 2014-10-04 [SC] [expires: 2024-01-30]
      EFC0A467D613CB83C7ED6D30D894E2CE8B3D79F5
uid           [ unknown] OpenSSL security team <openssl-security@openssl.org>
uid           [ unknown] OpenSSL OMC <openssl-omc@openssl.org>
uid           [ unknown] OpenSSL Security <openssl-security@openssl.org>
sub   rsa4096 2014-10-04 [E] [expires: 2024-01-30]

$ gpg --verify ../openssl-${OSSLVER}.tar.gz.asc ../openssl-${OSSLVER}.tar.gz
gpg: Signature made Tue Aug  1 15:47:28 2023 CEST
gpg:                using RSA key EFC0A467D613CB83C7ED6D30D894E2CE8B3D79F5
gpg: Good signature from "OpenSSL security team <openssl-security@openssl.org>" [unknown]
gpg:                 aka "OpenSSL OMC <openssl-omc@openssl.org>" [unknown]
gpg:                 aka "OpenSSL Security <openssl-security@openssl.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: EFC0 A467 D613 CB83 C7ED  6D30 D894 E2CE 8B3D 79F5
$ tar -x -X $XLIST -f ../openssl-${OSSLVER}.tar.gz -C ..
$ rsync --exclude FREEBSD.* --delete -avzz ../openssl-${OSSLVER}/* .
[...]
$ diff -arq ../openssl-${OSSLVER}  .
Only in .: .git
Only in .: FREEBSD-Xlist
Only in .: FREEBSD-upgrade
$ git status FREEBSD*
On branch vendor/openssl-3.0
Your branch is up to date with 'origin/vendor/openssl-3.0'.

nothing to commit, working tree clean
```

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D41293
2023-08-02 21:09:39 -04:00
Ed Maste a93cbba2de ssh: comment deprecated option handling for retired local patches
Older versions of FreeBSD included the HPN patch set and provided
client-side VersionAddendum.  Both of these changes have been retired
but we've retained the option parsing for backwards compatibility to
avoid breaking upgrades.  Add comment references to the relevant
commits.

Sponsored by:	The FreeBSD Foundation
2023-08-02 10:21:34 -04:00
Gleb Smirnoff 9ff45b8ed8 sshd: do not resolve refused client hostname
This is a compromise between POLA and practical reasoning.  We don't
want to block the main server loop in an attempt to resolve.  But we
need to keep the format of the logged message as is, for sake of
sshguard and other scripts.  So let's print just the IP address twice,
this is what libwrap's refuse() would do if it failed to resolve.

Reviewed by:		philip
PR:			269456
Differential revision:	https://reviews.freebsd.org/D40069
2023-07-20 14:56:20 -07:00
Gleb Smirnoff 90f10db8a9 sshd: remove unneeded initialization of libwrap logging severities
This part of ca573c9a17 proved to be unnecessary.  As the removed
comment says, we set them merely for logging syntax errors, as we log
refusals ourselves.  However, inside the libwrap the parser logs any
syntax errors with tcpd_warn() which has hardcoded LOG_WARNING inside.

Reviewed by:		philip, emaste
Differential revision:	https://reviews.freebsd.org/D40068
2023-07-20 14:56:20 -07:00
Ed Maste 66fd12cf48 ssh: Update to OpenSSH 9.3p2
From the release notes:

Changes since OpenSSH 9.3
=========================

This release fixes a security bug.

Security
========

Fix CVE-2023-38408 - a condition where specific libaries loaded via
ssh-agent(1)'s PKCS#11 support could be abused to achieve remote
code execution via a forwarded agent socket if the following
conditions are met:

* Exploitation requires the presence of specific libraries on
  the victim system.
* Remote exploitation requires that the agent was forwarded
  to an attacker-controlled system.

Exploitation can also be prevented by starting ssh-agent(1) with an
empty PKCS#11/FIDO allowlist (ssh-agent -P '') or by configuring
an allowlist that contains only specific provider libraries.

This vulnerability was discovered and demonstrated to be exploitable
by the Qualys Security Advisory team.

In addition to removing the main precondition for exploitation,
this release removes the ability for remote ssh-agent(1) clients
to load PKCS#11 modules by default (see below).

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

 * ssh-agent(8): the agent will now refuse requests to load PKCS#11
   modules issued by remote clients by default. A flag has been added
   to restore the previous behaviour "-Oallow-remote-pkcs11".

   Note that ssh-agent(8) depends on the SSH client to identify
   requests that are remote. The OpenSSH >=8.9 ssh(1) client does
   this, but forwarding access to an agent socket using other tools
   may circumvent this restriction.

CVE:		CVE-2023-38408
Sponsored by:	The FreeBSD Foundation
2023-07-19 13:02:33 -04:00
Ed Maste d5e2d0f140 openssh: document a locally-applied workaround
We have a local hacky workaround for an issue caused by a hacky
upstream autoconf test.  Reported upstream on the OpenSSH mailing list:
https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html

PR:		209441
Sponsored by:	The FreeBSD Foundation
2023-07-18 12:27:02 -04:00
Pierre Pronchery 7a991ecd1a libcrypto: add missing symbols to the fips provider
OpenSSL 3 supports a modular architecture, allowing different providers
to bring specific implementations of cryptographical algorithms. One
such provider, "fips", ships with OpenSSL 3 directly, and groups
algorithms that can be FIPS 140-2 validated.

The import of OpenSSL 3.0.9 was building this provider incorrectly,
missing symbols required for proper operation.

In addition, without the change in OpenSSL's crypto/bn/bn_const.c, the
FIPS module fails loading: `Undefined symbol "ossl_bignum_modp_1536_p"`.
This change is consistent with crypto/bn/bn_dh.c though.

Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/787
2023-07-05 16:00:54 -04:00
Mark Johnston 8e7046ff29 libcrypto: Revert recent changes to fix legacy and fips providers
They break the !amd64 builds due to an underspecified include path and
will be re-applied once that's fixed.

Reported by:	Ronald Klop <ronald-lists@klop.ws>
2023-07-04 16:38:26 -04:00
Pierre Pronchery 0102ee0d59 libcrypto: add missing symbols to the fips provider
OpenSSL 3 supports a modular architecture, allowing different providers
to bring specific implementations of cryptographical algorithms. One
such provider, "fips", ships with OpenSSL 3 directly, and groups
algorithms that can be FIPS 140-2 validated.

The import of OpenSSL 3.0.9 was building this provider incorrectly,
missing symbols required for proper operation.

In addition, without the change in OpenSSL's crypto/bn/bn_const.c, the
FIPS module fails loading: `Undefined symbol "ossl_bignum_modp_1536_p"`.
This change is consistent with crypto/bn/bn_dh.c though.

Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/787
2023-07-04 15:04:49 -04:00
Pierre Pronchery b077aed33b Merge OpenSSL 3.0.9
Migrate to OpenSSL 3.0 in advance of FreeBSD 14.0.  OpenSSL 1.1.1 (the
version we were previously using) will be EOL as of 2023-09-11.

Most of the base system has already been updated for a seamless switch
to OpenSSL 3.0.  For many components we've added
`-DOPENSSL_API_COMPAT=0x10100000L` to CFLAGS to specify the API version,
which avoids deprecation warnings from OpenSSL 3.0.  Changes have also
been made to avoid OpenSSL APIs that were already deprecated in OpenSSL
1.1.1.  The process of updating to contemporary APIs can continue after
this merge.

Additional changes are still required for libarchive and Kerberos-
related libraries or tools; workarounds will immediately follow this
commit.  Fixes are in progress in the upstream projects and will be
incorporated when those are next updated.

There are some performance regressions in benchmarks (certain tests in
`openssl speed`) and in some OpenSSL consumers in ports (e.g.  haproxy).
Investigation will continue for these.

Netflix's testing showed no functional regression and a rather small,
albeit statistically significant, increase in CPU consumption with
OpenSSL 3.0.

Thanks to ngie@ and des@ for updating base system components, to
antoine@ and bofh@ for ports exp-runs and port fixes/workarounds, and to
Netflix and everyone who tested prior to commit or contributed to this
update in other ways.

PR:		271615
PR:		271656 [exp-run]
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2023-06-23 18:53:36 -04:00
Pierre Pronchery b84c4564ef openssl: Vendor import of OpenSSL-3.0.9
Summary:

Release notes can be found at
https://www.openssl.org/news/openssl-3.0-notes.html .

Obtained from:  https://www.openssl.org/source/openssl-3.0.9.tar.gz

Test Plan:
```
$ git status
On branch vendor/openssl-3.0
Your branch is up to date with 'origin/vendor/openssl-3.0'.

nothing to commit, working tree clean
$ (cd ..; fetch http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz.asc)
openssl-3.0.9.tar.gz                                    14 MB   74 MBps    01s
openssl-3.0.9.tar.gz.asc                               833  B   10 MBps    00s
$ set | egrep '(XLIST|OSSLVER)='
OSSLVER=3.0.9
XLIST=FREEBSD-Xlist
$ gpg --list-keys
/home/khorben/.gnupg/pubring.kbx
--------------------------------
pub   rsa4096 2021-07-16 [SC] [expires: 2031-07-14]
      A21FAB74B0088AA361152586B8EF1A6BA9DA2D5C
uid           [ unknown] Tomáš Mráz <tm@t8m.info>
uid           [ unknown] Tomáš Mráz <tomas@arleto.cz>
uid           [ unknown] Tomáš Mráz <tomas@openssl.org>
sub   rsa4096 2021-07-16 [S] [expires: 2027-07-15]
sub   rsa4096 2021-07-16 [E] [expires: 2031-07-14]

$ gpg --verify ../openssl-${OSSLVER}.tar.gz.asc ../openssl-${OSSLVER}.tar.gz
gpg: Signature made Tue May 30 14:32:24 2023 CEST
gpg:                using RSA key DC7032662AF885E2F47F243F527466A21CA79E6D
gpg: Good signature from "Tomáš Mráz <tm@t8m.info>" [unknown]
gpg:                 aka "Tomáš Mráz <tomas@arleto.cz>" [unknown]
gpg:                 aka "Tomáš Mráz <tomas@openssl.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: A21F AB74 B008 8AA3 6115  2586 B8EF 1A6B A9DA 2D5C
     Subkey fingerprint: DC70 3266 2AF8 85E2 F47F  243F 5274 66A2 1CA7 9E6D

$ tar -x -X $XLIST -f ../openssl-${OSSLVER}.tar.gz -C ..
$ rsync --exclude FREEBSD.* --delete -avzz ../openssl-${OSSLVER}/* .
[...]
$ diff -arq ../openssl-${OSSLVER}  .
Only in .: .git
Only in .: FREEBSD-Xlist
Only in .: FREEBSD-upgrade
$ git status FREEBSD*
On branch vendor/openssl-3.0
Your branch is up to date with 'origin/vendor/openssl-3.0'.

nothing to commit, working tree clean
```
2023-06-23 09:13:27 -04:00
Jung-uk Kim 8f1ef87a6b OpenSSL: Merge OpenSSL 1.1.1u
(cherry picked from commit 8ecb489345f08012fdc92a202a40119891cac330)
2023-05-30 10:40:04 -04:00
Ed Maste 170511589e openssh: Update configure for DISABLE_LASTLOG
PR:		209441
Sponsored by:	The FreeBSD Foundation
2023-04-20 18:08:16 -04:00
Ed Maste 43c6b7a60a openssh: restore PrintLastLog option
Upstream's autoconf sets DISABLE_LASTLOG if lastlog.ll_line does not
exist, but PrintLastLog also works with utmpx and other mechanisms.

Reported upstream at
https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html

PR:		209441
Sponsored by:	The FreeBSD Foundation
2023-04-19 21:17:59 -04:00
Ed Maste 9faa27f263 ssh: update FREEBSD-upgrade for upstream CheckHostIP default change
We changed the CheckHostIP default to "no" years ago.  Upstream has now
made the same change, so do not list it as a local change any longer.

I did not just remove the "Modified client-side defaults" section to
avoid having to renumber everything, and we may add a new local change
in the future.

Sponsored by:	The FreeBSD Foundation
2023-03-29 19:32:44 -04:00
Ed Maste c888b3b228 sftp: add description of memory leak fix 2023-03-22 11:04:29 -04:00
Ed Maste 69c72a57af sftp: avoid leaking path arg in calls to make_absolute_pwd_glob
As Coverity reports:
    Overwriting tmp in tmp = make_absolute_pwd_glob(tmp, remote_path)
    leaks the storage that tmp points to.

Consume the first arg in make_absolute_pwd_glob, and add xstrdup() to
the one case which did not assign to the same variable that was passed
in. With this change make_absolute() and make_absolute_pwd_glob() have
the same semantics with respect to freeing the input string.

This change was reported to OpenSSH in
https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-November/040497.html
but was not acted on. It appears that OpenBSD subsequently received a
Coverity report for the same issue (their Coverity ID 405196) but fixed
only the specific instance reported by Coverity.

This change reverts OpenBSD's sftp.c 1.228 / OpenSSH-portable
commit 36c6c3eff5e4.

Reported by:	Coverity Scan
CID:		1500409
Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37253
2023-03-22 10:54:35 -04:00
Kornel Dulęba 19a4869d66 OpenSSL: aes/asm/bsaes-armv7.pl: Replace adrl with add
"adrl" is a pseudo-instruction used to calculate an address relative
to PC. It's not recognized by clang resulting in a compilation error.
I've stumbled upon it when trying to integrate the bsaes-armv7 assmebly
logic into FreeBSD kernel, which uses clang as it's default compiler.
Note that this affect the build only if BSAES_ASM_EXTENDED_KEY is
defined, which is not the default option in OpenSSL.

The solution here is to replace it with an add instruction.
This mimics what has already been done in !BSAES_ASM_EXTENDED_KEY logic.
Because of that I've marked this as trivial CLA.

No objections from: jkim
Obtained from: OpenSSL commit 27093ba73372935fe4ef91d0a45ce6ea90a1ac8e
Differential Revision:	https://reviews.freebsd.org/D39091
2023-03-21 20:04:04 +01:00
Ed Maste 4d3fc8b057 ssh: Update to OpenSSH 9.3p1
This release fixes a number of security bugs and has minor new
features and bug fixes.  Security fixes, from the release notes
(https://www.openssh.com/txt/release-9.3):

This release contains fixes for a security problem and a memory
safety problem. The memory safety problem is not believed to be
exploitable, but we report most network-reachable memory faults as
security bugs.

 * ssh-add(1): when adding smartcard keys to ssh-agent(1) with the
   per-hop destination constraints (ssh-add -h ...) added in OpenSSH
   8.9, a logic error prevented the constraints from being
   communicated to the agent. This resulted in the keys being added
   without constraints. The common cases of non-smartcard keys and
   keys without destination constraints are unaffected. This problem
   was reported by Luci Stanescu.

 * ssh(1): Portable OpenSSH provides an implementation of the
   getrrsetbyname(3) function if the standard library does not
   provide it, for use by the VerifyHostKeyDNS feature. A
   specifically crafted DNS response could cause this function to
   perform an out-of-bounds read of adjacent stack data, but this
   condition does not appear to be exploitable beyond denial-of-
   service to the ssh(1) client.

   The getrrsetbyname(3) replacement is only included if the system's
   standard library lacks this function and portable OpenSSH was not
   compiled with the ldns library (--with-ldns). getrrsetbyname(3) is
   only invoked if using VerifyHostKeyDNS to fetch SSHFP records. This
   problem was found by the Coverity static analyzer.

Sponsored by:	The FreeBSD Foundation
2023-03-16 10:29:55 -04:00
Ed Maste 6834ca8a43 ssh: update FREEBSD-upgrade instructions
Make it clear that the 'freebsd-configure.sh' and 'freebsd-namespace.sh'
scripts are run from the crypto/openssh directory.

Sponsored by:	The FreeBSD Foundation
2023-03-15 13:37:49 -04:00
Ed Maste 19aba210e1 ssh: fix leak and apply style(9) to hostname canonicalization
Fixes:		bf2e2524a2 ("ssh: canonicize the host name before...")
Fixes:		3e74849a1e ("ssh: canonicize the host name before...")
Reviewed by:	rew
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38441
2023-03-14 13:16:57 -04:00
Cy Schubert 5abaf08664 heimdal: Fix CVE-2022-4152, signature validation error
When CVE-2022-3437 was fixed by changing memcmp to be a constant
time and the workaround for th e compiler was to add "!=0". However
the logic implmented was inverted resulting in CVE-2022-4152.

Reported by:	Timothy E Zingelman <zingelman _AT_ fnal.gov>
MFC after:	1 day
Security:	CVE-2022-4152
Security:	https://www.cve.org/CVERecord?id=CVE-2022-45142
Security:	https://nvd.nist.gov/vuln/detail/CVE-2022-45142
Security:	https://security-tracker.debian.org/tracker/CVE-2022-45142
Security:	https://bugs.gentoo.org/show_bug.cgi?id=CVE-2022-45142
Security:	https://bugzilla.samba.org/show_bug.cgi?id=15296
Security:	https://www.openwall.com/lists/oss-security/2023/02/08/1
2023-03-09 17:18:49 -08:00
Enji Cooper e4520c8bd1 openssl: Vendor import of OpenSSL-3.0.8
Summary:

Release notes can be found at
https://www.openssl.org/news/openssl-3.0-notes.html .

Obtained from:  https://www.openssl.org/source/openssl-3.0.8.tar.gz
Differential Revision:	https://reviews.freebsd.org/D38835

Test Plan:
```
$ git status
On branch vendor/openssl-3.0
nothing to commit, working tree clean
$ (cd ..; fetch http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz.asc)
openssl-3.0.8.tar.gz                                    14 MB 4507 kBps    04s
openssl-3.0.8.tar.gz.asc                               833  B   10 MBps    00s
$ set | egrep '(XLIST|OSSLVER)='
OSSLVER=3.0.8
XLIST=FREEBSD-Xlist
$ gpg --list-keys
/home/ngie/.gnupg/pubring.kbx
-----------------------------
pub   rsa4096 2014-10-04 [SC]
      7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C
uid           [ unknown] Richard Levitte <richard@levitte.org>
uid           [ unknown] Richard Levitte <levitte@lp.se>
uid           [ unknown] Richard Levitte <levitte@openssl.org>
sub   rsa4096 2014-10-04 [E]

$ gpg --verify openssl-${OSSLVER}.tar.gz.asc openssl-${OSSLVER}.tar.gz
gpg: Signature made Tue Feb  7 05:43:55 2023 PST
gpg:                using RSA key 7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C
gpg: Good signature from "Richard Levitte <richard@levitte.org>" [unknown]
gpg:                 aka "Richard Levitte <levitte@lp.se>" [unknown]
gpg:                 aka "Richard Levitte <levitte@openssl.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7953 AC1F BC3D C8B3 B292  393E D5E9 E43F 7DF9 EE8C
$ (cd vendor.checkout/; git status; find . -type f -or -type l | cut -c 3- | sort > ../old)
On branch vendor/openssl-3.0
nothing to commit, working tree clean
$ tar -x -X $XLIST -f ../openssl-${OSSLVER}.tar.gz -C ..
$ rsync --exclude FREEBSD.* --delete -avzz ../openssl-${OSSLVER}/* .
$ cat .git
gitdir: /home/ngie/git/freebsd-src/.git/worktrees/vendor.checkout
$ diff -arq ../openssl-3.0.8  .
Only in .: .git
Only in .: FREEBSD-Xlist
Only in .: FREEBSD-upgrade
$ git status FREEBSD*
On branch vendor/openssl-3.0
nothing to commit, working tree clean
$
```

Reviewers: emaste, jkim

Subscribers: imp, andrew, dab

Differential Revision: https://reviews.freebsd.org/D38835
2023-03-06 12:41:29 -08:00
Ed Maste 41ff5ea22c ssh: default VerifyHostKeyDNS to no, following upstream
Revert to upstream's default.  Using VerifyHostKeyDNS may depend on a
trusted nameserver and network path.

This reverts commit 83c6a5242c.

Reported by:	David Leadbeater, G-Research
Reviewed by:	gordon
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38648
2023-03-01 09:19:07 -05:00
Jung-uk Kim 3c320f4e5e Import OpenSSL 1.1.1t 2023-02-28 19:28:48 -08:00
Jung-uk Kim aba33b3659 Import OpenSSL 1.1.1s 2023-02-28 19:28:39 -08:00
Ed Maste 1aa9a35f63 ssh: fix SIZEOF_TIME_T #define on i386
Reported by:	imp
Reviewed by:	imp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38443
2023-02-08 18:34:09 -05:00
Cy Schubert 6a70e0b4cd heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL
When the client sends kadmind a create principal (kadm_create) request
kadm_s_create_principal() returns an error before zeroing out ent (an
hdb entry structure wrapper -- hdb_entry_ex), resulting in a NULL
reference.

Fix obtained from upstream commit 35ea4955a.

PR:		268059
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Obtained from:	Heimdal commit 35ea4955a
MFC after:	3 days
2023-02-08 15:08:54 -08:00
Ed Maste 232b4f33b4 ssh: add information on hostname canonicalization patch
We introduced hostname canonicalization in 2002, while upstream OpenSSH
added similar support in 2014.

It would be good to review our handling of CNAMEs in hostname
canonicalization.

Sponsored by:	The FreeBSD Foundation
2023-02-07 15:34:11 -05:00
Jung-uk Kim 640242a591 OpenSSL: Merge OpenSSL 1.1.1t
Merge commit '0d51f658515c605fcc4a8073cb5a8e0d7d904088'
2023-02-07 13:51:38 -05:00
Jung-uk Kim 0d51f65851 Import OpenSSL 1.1.1t 2023-02-07 12:05:11 -05:00
Ed Maste 77934b7a13 ssh: default X11Forwarding to no, following upstream
Administrators can enable it if required.

Reviewed by:	bz, kevans
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37411
2023-02-06 18:41:10 -05:00
Ed Maste f374ba41f5 ssh: update to OpenSSH 9.2p1
Release notes are available at https://www.openssh.com/txt/release-9.2

OpenSSH 9.2 contains fixes for two security problems and a memory safety
problem.  The memory safety problem is not believed to be exploitable.
These fixes have already been committed to OpenSSH 9.1 in FreeBSD.

Some other notable items from the release notes:

 * ssh(1): add a new EnableEscapeCommandline ssh_config(5) option that
   controls whether the client-side ~C escape sequence that provides a
   command-line is available. Among other things, the ~C command-line
   could be used to add additional port-forwards at runtime.

 * sshd(8): add support for channel inactivity timeouts via a new
   sshd_config(5) ChannelTimeout directive. This allows channels that
   have not seen traffic in a configurable interval to be
   automatically closed. Different timeouts may be applied to session,
   X11, agent and TCP forwarding channels.

 * sshd(8): add a sshd_config UnusedConnectionTimeout option to
   terminate client connections that have no open channels for a
   length of time. This complements the ChannelTimeout option above.
    
 * sshd(8): add a -V (version) option to sshd like the ssh client has.

 * scp(1), sftp(1): add a -X option to both scp(1) and sftp(1) to
   allow control over some SFTP protocol parameters: the copy buffer
   length and the number of in-flight requests, both of which are used
   during upload/download. Previously these could be controlled in
   sftp(1) only. This makes them available in both SFTP protocol
   clients using the same option character sequence.
    
 * ssh-keyscan(1): allow scanning of complete CIDR address ranges,
   e.g.  "ssh-keyscan 192.168.0.0/24". If a CIDR range is passed, then
   it will be expanded to all possible addresses in the range
   including the all-0s and all-1s addresses. bz#976

 * ssh(1): support dynamic remote port forwarding in escape
   command-line's -R processing. bz#3499

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-02-06 16:54:56 -05:00
Ed Maste 2e82822057 ssh: Be more paranoid with host/domain names coming from the
never write a name with bad characters to a known_hosts file.

replace recently-added valid_domain() check for hostnames going to
known_hosts with a more relaxed check for bad characters.

Obtained from:	OpenSSH-portable commit 445363433ba2
Obtained from:	OpenSSH-portable commit 3cae9f92a318
Sponsored by:	The FreeBSD Foundation
2023-02-06 12:06:26 -05:00
Ed Maste 94e21add45 ssh: fix bug in PermitRemoteOpen which caused it to ignore...
its first argument unless it was one of the special keywords "any" or
"none".

Obtained from:	OpenSSH-portable commit b3daa8dc5823
Sponsored by:	The FreeBSD Foundation
2023-02-06 11:33:38 -05:00
Ed Maste fe1371e8f3 ssh: fix double-free caused by compat_kex_proposal()
Security:	CVE-2023-25136
Obtained from:	OpenSSH-portable commit 12da78233364
Sponsored by:	The FreeBSD Foundation
2023-02-06 11:31:18 -05:00
Ed Maste c755a7cc1e ssh: remove old reference from update instructions
ssh_config and ssh_config.5 no longer contain the VersionAddendum,
so remove instructions to update these files.

Fixes:		bffe60ead0 ("ssh: retire client VersionAddendum")
Sponsored By:	The FreeBSD Foundation
2023-02-05 13:17:46 -05:00
Ed Maste 9b7eddfeed openssh: remove mention of now-unused svn:keywords
Reported by:	gshapiro
2023-01-16 10:56:27 -05:00
Ed Maste 8974fa4515 ssh: describe two additional changes present in base system ssh
Sponsored by:	The FreeBSD Foundation
2022-12-13 09:45:56 -05:00
Ed Maste a752e011a8 ssh: remove note about local change to [Use]PrivilegeSeparation
We documented "[Use]PrivilegeSeparation defaults to sandbox" as one of
our modifications to ssh's server-side defaults, but this is not (any
longer) a difference from upstream.

Sponsored by:	The FreeBSD Foundation
2022-12-12 17:07:27 -05:00
Cy Schubert f6d5d31cd5 heimdal: kadm5_c_get_principal() should check return code
kadm5_c_get_principal() should check the return code from
kadm5_ret_principal_ent(). As it doesn't it assumes success when
there is none and can lead to potential vulnerability. Fix this.

Reported by:	rtm@csail.mit.edu
MFC after:	3 days
2022-12-09 06:09:54 -08:00
Cy Schubert 3deefb0d14 heimdal: Properly ix bus fault when zero-length request received
Zero length client requests result in a bus fault when attempting to
free malloc()ed pointers within the requests softc. Return an error
when the request is zero length.

This properly fixes PR/268062 without regressions.

PR:		268062
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-12-09 06:09:54 -08:00
Cy Schubert 5319949668 Revert "heimdal: Fix bus fault when zero-length request received"
This is the wrong fix for PR/268062.

MFC after:	immediately

This reverts commit 6742ff42ab.
2022-12-09 06:09:54 -08:00
Cy Schubert 6742ff42ab heimdal: Fix bus fault when zero-length request received
Zero length client requests result in a bus fault when attempting to
free malloc()ed pointers within the requests softc. Return an error
when the request is zero length.

PR:		268062
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-12-01 06:24:12 -08:00
Cy Schubert d24b272832 heimdal: Add additional checks for bad kadmind input
Check return codes for bad input.

MFC after:	3 days
2022-12-01 06:24:12 -08:00
Cy Schubert 671f55828d heimdal: Check return code from _hdb_fetch_kvno()
A malformed principal will cause kadmind to segfault. The PR
addresses only when chpass is requested but delete is also affected.
Fix both.

PR:		268002
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert 5040a7a9aa heimdal: Add missing iprop error checks.
Inspired by upstream 9d6dd21256f87988605fa75172be9cc92535064c.

Obtained from:	Heimdal 9d6dd21256f87988605fa75172be9cc92535064c
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert 80999dcd5b heimdal: Add missing kadmind error checks
Inspired by:	Heimdal commmit 1b213c1082be4ef5a1c23928d614c762f837dbe7
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert 879b0e9cd2 heimdal: Add missing kadm5 error checks
Obtained from:	Heimdal commit 4a0e01f9edabe36d0f2cab188078dd29fa5aaf02
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert 780f663df3 heimdal: Add missing kadm5 error checks
Generally obtained from upstream 655c057769f56bd8cdb7d16e93f1e7a7cb260342.

PR:		267944, 267972
Obtained from:	Heimdal commit 655c057769f56bd8cdb7d16e93f1e7a7cb260342
MFC after:	3 days
2022-11-26 18:41:51 -08:00
Cy Schubert e13150e28c heimdal: Fix uninitialized pointer dereference
krb5_ret_preincipal() returns a non-zero return code when
a garbage principal is passed to it. Unfortunately ret_principal_ent()
does not check the return code, with garbage pointing to what would
have been the principal. This results in a segfault when free() is
called.

PR:		267944, 267972
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-26 18:41:51 -08:00
Cy Schubert 91db848212 heimdal: Handle other types of garbage data
In addition to garbage realm data, also handle garbage dbname, acl_file,
stash_file, and invalid bitmask garbage data.

PR:		267912
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-24 09:23:23 -08:00
Cy Schubert 05bc50bdb1 heimdal: Fix NULL dereference when mangled realm message
Fix a NULL dereference in _kadm5_s_init_context() when the client
sends a mangled realm message.

PR:		267912
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-24 09:21:13 -08:00
Cy Schubert d7e8666ffb heimdal: The version string must always contain a terminating NUL
Should the sender send a string without a terminating NUL, ensure that
the NUL terminates the string regardless.

And while at it only process the version string when bytes are returned.

PR:		267884
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37471
2022-11-24 09:21:13 -08:00
Cy Schubert f556a05c49 heimdal: Fix: Too large time skew, client time 1970-01-01T01:00:00
Part of ed549cb0c5 zeroed out a data structure in the resulting code-file
when a TUTCTime type was freed. This part of the patch applies to Heimdal
7.1+ and not our Heimdal 1.5.2.

PR:		267827
Reported by:	Peter Much <pmc@citylink.dinoex.sub.org>
Tested by:	Peter Much <pmc@citylink.dinoex.sub.org>
Fixes:		ed549cb0c5
MFC after:	TBD with philip@
2022-11-17 09:29:17 -08:00
Cy Schubert ed549cb0c5 heimdal: Fix multiple security vulnerabilities
The following issues are patched:

 - CVE-2022-42898 PAC parse integer overflows
 - CVE-2022-3437 Overflows and non-constant time leaks in DES{,3} and arcfour
 - CVE-2021-44758 NULL dereference DoS in SPNEGO acceptors
 - CVE-2022-44640 Heimdal KDC: invalid free in ASN.1 codec

    Note that CVE-2022-44640 is a severe vulnerability, possibly a 10.0
    on the Common Vulnerability Scoring System (CVSS) v3, as we believe
    it should be possible to get an RCE on a KDC, which means that
    credentials can be compromised that can be used to impersonate
    anyone in a realm or forest of realms.

    Heimdal's ASN.1 compiler generates code that allows specially
    crafted DER encodings of CHOICEs to invoke the wrong free function
    on the decoded structure upon decode error.  This is known to impact
    the Heimdal KDC, leading to an invalid free() of an address partly
    or wholly under the control of the attacker, in turn leading to a
    potential remote code execution (RCE) vulnerability.

    This error affects the DER codec for all extensible CHOICE types
    used in Heimdal, though not all cases will be exploitable.  We have
    not completed a thorough analysis of all the Heimdal components
    affected, thus the Kerberos client, the X.509 library, and other
    parts, may be affected as well.

    This bug has been in Heimdal's ASN.1 compiler since 2005, but it may
    only affect Heimdal 1.6 and up.  It was first reported by Douglas
    Bagnall, though it had been found independently by the Heimdal
    maintainers via fuzzing a few weeks earlier.

    While no zero-day exploit is known, such an exploit will likely be
    available soon after public disclosure.

 - CVE-2019-14870: Validate client attributes in protocol-transition
 - CVE-2019-14870: Apply forwardable policy in protocol-transition
 - CVE-2019-14870: Always lookup impersonate client in DB

Sponsored by:	so (philip)
Obtained from:	so (philip)
Tested by:	philip, cy
MFC after:	immediately
2022-11-15 13:12:37 -08:00
Ed Maste c72f259727 ssh: remove VersionAddendum from list of client side config changes
Fixes: bffe60ead0 ("ssh: retire client VersionAddendum")
Sponsored by:	The FreeBSD Foundation
2022-11-14 15:33:51 -05:00
Ed Maste 733bf3b108 ssh: update comment text to match upstream
Reported by:	bz
Obtained from:	OpenSSH dffa64480163
2022-11-09 11:32:47 -05:00
Ed Maste 4232f36eda sshd: sync tracing disable with upstream
Old versions of FreeBSD do not support using id 0 to refer to the
current pid for procctl, so pass getpid() explicitly.

Although this is not required in current FreeBSD branches I am merging
it to reduce differences with upstream.

Obtained from:	OpenSSH commit 0f7e1eba5525
2022-11-07 12:23:00 -05:00
Ed Maste 0657b2325d ssh: correct parse_cert_times case for hex "to" time
This appeared to be a copy-paste error from the "from" time case above.

Reported by:	Coverity Scan
CID:		1500407
Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37252
2022-11-03 10:10:28 -04:00
Jung-uk Kim cfc39718e9 OpenSSL: Merge OpenSSL 1.1.1s
Merge commit 'b6b67f23b82101d4c04c89f81d726b902ab77106'
2022-11-01 18:58:59 -04:00
Jung-uk Kim b6b67f23b8 Import OpenSSL 1.1.1s 2022-11-01 18:43:36 -04:00
Ed Maste 38a52bd3b5 ssh: update to OpenSSH 9.1p1
Release notes are available at https://www.openssh.com/txt/release-9.1

9.1 contains fixes for three minor memory safety problems; these have
lready been merged to the copy of OpenSSH 9.0 that is in the FreeBSD base
system.

Some highlights copied from the release notes:

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

 * ssh(1), sshd(8): SetEnv directives in ssh_config and sshd_config
   are now first-match-wins to match other directives. Previously
   if an environment variable was multiply specified the last set
   value would have been used. bz3438

 * ssh-keygen(8): ssh-keygen -A (generate all default host key types)
   will no longer generate DSA keys, as these are insecure and have
   not been used by default for some years.

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

 * ssh(1), sshd(8): add a RequiredRSASize directive to set a minimum
   RSA key length. Keys below this length will be ignored for user
   authentication and for host authentication in sshd(8).

 * sftp-server(8): add a "users-groups-by-id@openssh.com" extension
   request that allows the client to obtain user/group names that
   correspond to a set of uids/gids.

 * sftp(1): use "users-groups-by-id@openssh.com" sftp-server
   extension (when available) to fill in user/group names for
   directory listings.

 * sftp-server(8): support the "home-directory" extension request
   defined in draft-ietf-secsh-filexfer-extensions-00. This overlaps
   a bit with the existing "expand-path@openssh.com", but some other
   clients support it.

 * ssh-keygen(1), sshd(8): allow certificate validity intervals,
   sshsig verification times and authorized_keys expiry-time options
   to accept dates in the UTC time zone in addition to the default
   of interpreting them in the system time zone. YYYYMMDD and
   YYMMDDHHMM[SS] dates/times will be interpreted as UTC if suffixed
   with a 'Z' character.

   Also allow certificate validity intervals to be specified in raw
   seconds-since-epoch as hex value, e.g. -V 0x1234:0x4567890. This
   is intended for use by regress tests and other tools that call
   ssh-keygen as part of a CA workflow. bz3468

 * sftp(1): allow arguments to the sftp -D option, e.g. sftp -D
   "/usr/libexec/sftp-server -el debug3"

 * ssh-keygen(1): allow the existing -U (use agent) flag to work
   with "-Y sign" operations, where it will be interpreted to require
   that the private keys is hosted in an agent; bz3429

MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2022-10-19 10:27:11 -04:00
Ed Maste fca7ac55f8 ssh: remove pre- and post-merge update steps
We no longer use the pre- and post-merge scripts to strip/add RCS tags.
The tags have been removed from main, but persist on older branches.

While here renumber the steps in the update documentation using a more
conventional scheme.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36904
2022-10-12 13:54:08 -04:00
Ed Maste a1e39f96d2 nanobsd: remove unmodified copies of ssh config files
Nanobsd included copies of ssh_config and sshd_config.  The former is
identical to the one provided by the base system, and the latter is
identical except for PermitRootLogin, which is updated by nanobsd's
cust_allow_ssh_root anyhow.  Remove nanobsd's copies and use the
existing base system ones.

Reported by:	Jose Luis Duran <jlduran@gmail.com> in D34937
Reviewed by:	Jose Luis Duran <jlduran@gmail.com>, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36933
2022-10-11 12:53:57 -04:00
Ed Maste 963c7b084b ssh-keysign: fix double free in error path
From OpenSSH-portable commit 141535b904b6, OpenBSD commit 3d21aa127b1f.

MFC after:		3 days
2022-10-04 16:34:37 -04:00
Ed Maste 666605ad2d ssh-keygen: fix double free in error path
From OpenSSH-portable commit 5062ad48814b, OpenBSD commit 39f35e16ba87.

MFC after:	3 days
2022-10-04 16:33:11 -04:00
Ed Maste 5e5ebbee81 ssh-keyscan: Strictly enforce the maximum allowed SSH2 banner size
From OpenSSH-portable commit ff89b1bed807, OpenBSD commit 6ae664f9f4db.

MFC after:	3 days
2022-10-04 16:30:00 -04:00
Ed Maste 6f7bc8e7a3 ssh: describe deprecated options in general in update doc
Rename "HPN" to more general "Retired patches."  We handle two now-
removed patches the same way: to avoid breaking existing configurations
we accept, but ignore, the option.

Sponsored by:	The FreeBSD Foundation
2022-09-04 20:11:03 -04:00
Ed Maste 97be6fced7 openssh: Remove description of VersionAddendum in upgrade doc 2022-08-19 10:39:17 -04:00
Ed Maste bffe60ead0 ssh: retire client VersionAddendum
FreeBSD introduced VersionAddendum for the server as a local change in
2001 in commit 933ca70f8f and later extended it to the client in
commit 9e2cbe04ff.

In 2012 upstream added support for server VersionAddendum, in commit
23528816dc10.  They do not support it for the client.

The argument for supporting this in the client is not nearly as strong
as for the server, so retire this option to reduce the scope of our
local patch set.  This also avoids some cases of conflicts in ssh_config
during update, as a user's configuration would typically follow the
commented-out default VersionAddendum value.

Reviewed by:	gordon, glebius
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32930
2022-08-19 10:38:42 -04:00
Jung-uk Kim 64cbf7cebc OpenSSL: Merge OpenSSL 1.1.1q
Merge commit 'f874e59ffcd8b5ecd018ad8311d78e866340f3e9'
2022-07-05 11:47:01 -04:00
Jung-uk Kim f874e59ffc Import OpenSSL 1.1.1q 2022-07-05 11:27:51 -04:00
Jung-uk Kim 83eaf7ae0a OpenSSL: Merge OpenSSL 1.1.1p
Merge commit '54ae8e38f717f22963c2a87f48af6ecefc6b3e9b'
2022-06-21 13:34:41 -04:00
Jung-uk Kim 54ae8e38f7 Import OpenSSL 1.1.1p 2022-06-21 10:36:39 -04:00
Ed Maste 9f009e066f sshd_config: clarify password authentication options
Passwords may be accepted by both the PasswordAuthentication and
KbdInteractiveAuthentication authentication schemes.  Add a reference to
the latter in the description/comment for PasswordAuthentication, as it
otherwise may seem that "PasswordAuthentication no" implies passwords
will be disallowed.

This situation should be clarified with more extensive documentation on
the authentication schemes and configuration options, but that should be
done in coordination with upstream OpenSSH.  This is a minimal change
that will hopefully clarify the situation without requiring an extensive
local patch set.

PR:		263045
Reviewed by:	manu (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35272
2022-06-08 16:20:46 -04:00
Ed Maste 0e12eb7b58 ssh: update sshd_config for prohibit-password option
The PermitRootLogin option "prohibit-password" was added as a synonym
for "without-password" in 2015.  Then in 2017 these were swapped:
"prohibit-password" became the canonical option and "without-password"
became a deprecated synonym (in OpenSSH commit 071325f458).

The UsePAM description in sshd_config still mentioned
"without-password."  Update it to match the new canonical option.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-05-12 11:16:09 -04:00
John Baldwin 913616b885 OpenSSL: KTLS: Enable KTLS for receiving as well in TLS 1.3
This removes a guard condition that prevents KTLS being enabled for
receiving in TLS 1.3.  Use the correct sequence number and BIO for
receive vs transmit offload.

Approved by:	jkim
Obtained from:	OpenSSL commit 7c78932b9a4330fb7c8db72b3fb37cbff1401f8b
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34976
2022-05-04 13:08:36 -07:00
John Baldwin c0f977bfb6 OpenSSL: KTLS: Handle TLS 1.3 in ssl3_get_record.
- Don't unpad records, check the outer record type, or extract the
  inner record type from TLS 1.3 records handled by the kernel.  KTLS
  performs all of these steps and returns the inner record type in the
  TLS header.

- When checking the length of a received TLS 1.3 record don't allow
  for the extra byte for the nested record type when KTLS is used.

- Pass a pointer to the record type in the TLS header to the
  SSL3_RT_INNER_CONTENT_TYPE message callback.  For KTLS, the old
  pointer pointed to the last byte of payload rather than the record
  type.  For the non-KTLS case, the TLS header has been updated with
  the inner type before this callback is invoked.

Approved by:	jkim
Obtained from:	OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34975
2022-05-04 13:08:27 -07:00
John Baldwin 4f1f9c5502 OpenSSL: KTLS: Add using_ktls helper variable in ssl3_get_record().
When KTLS receive is enabled, pending data may still be present due to
read ahead.  This data must still be processed the same as records
received without KTLS.  To ease readability (especially in
consideration of additional checks which will be added for TLS 1.3),
add a helper variable 'using_ktls' that is true when the KTLS receive
path is being used to receive a record.

Approved by:	jkim
Obtained from:	OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34974
2022-05-04 13:08:17 -07:00
John Baldwin 019cff03b3 OpenSSL: KTLS: Check for unprocessed receive records in ktls_configure_crypto.
KTLS implementations currently assume that the start of the in-kernel
socket buffer is aligned with the start of a TLS record for the
receive side.  The socket option to enable KTLS specifies the TLS
sequence number of this initial record.

When read ahead is enabled, data can be pending in the SSL read buffer
after negotiating session keys.  This pending data must be examined to
ensurs that the kernel's socket buffer does not contain a partial TLS
record as well as to determine the correct sequence number of the
first TLS record to be processed by the kernel.

In preparation for enabling receive kernel offload for TLS 1.3, move
the existing logic to handle read ahead from t1_enc.c into ktls.c and
invoke it from ktls_configure_crypto().

Approved by:	jkim
Obtained from:	OpenSSL commit 85773128d0e80cd8dcc772a6931d385b8cf4acd1
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34973
2022-05-04 13:08:03 -07:00
John Baldwin f6e5fcdc84 OpenSSL: Cleanup record length checks for KTLS
In some corner cases the check for packets
which exceed the allowed record length was missing
when KTLS is initially enabled, when some
unprocessed packets are still pending.

Approved by:	jkim
Obtained from:	OpenSSL commit 8fff986d52606e1a33f9404504535e2e2aee3e8b
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34972
2022-05-04 13:07:36 -07:00
Jung-uk Kim 34252e89a9 OpenSSL: Merge OpenSSL 1.1.1o
Merge commit 'cf0ffd7607ed8f39829c6951a65a55fa1eb3aafe'
2022-05-03 15:07:06 -04:00
Jung-uk Kim cf0ffd7607 Import OpenSSL 1.1.1o 2022-05-03 11:01:12 -04:00
Ed Maste 6e24fe6128 ssh: use upstream SSH_OPENSSL_VERSION macro
With the upgrade to OpenSSH 6.7p1 in commit a0ee8cc636 we replaced
WITH_OPENSSL ifdefs with an OPENSSL_VERSION macro, later changing it
to OPENSSL_VERSION_STRING.

A few years later OpenSSH made an equivalent change (with a different
macro name), in commit 4d94b031ff88.  Switch to the macro name they
chose.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-23 20:07:57 -04:00
Ed Maste 835ee05f3c ssh: drop $FreeBSD$ from crypto/openssh
After we moved to git $FreeBSD$ is no longer expanded and serves no
purpose.  Remove them from OpenSSH to reduce diffs against upstream.

Sponsored by:	The FreeBSD Foundation
2022-04-22 19:12:23 -04:00
Ed Maste 1978059263 ssh: remove duplicate setting of MAIL env var
We already set it earlier in do_setup_env().

Fixes:		19261079b7 ("openssh: update to OpenSSH v8.7p1")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-19 10:30:52 -04:00
Ed Maste 613b4b7971 ssh: apply style(9) to version_addendum
Reported by:	allanjude (in review D29953)
Fixes:		462c32cb8d ("Upgrade OpenSSH to 6.1p1.")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-18 18:13:42 -04:00
Ed Maste eb45bc6829 ssh-agent: move -x description to correct spot in man page
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-04-17 17:43:20 -04:00
Ed Maste e2cec5ba2c ssh: correct version number (9.0)
Reported by:	flo
Fixes:		87c1498d1a ("ssh: update to OpenSSH v9.0p1")
Sponsored by:	The FreeBSD Foundation
2022-04-15 12:10:35 -04:00
Ed Maste 9fce8d4140 ssh: apply post-release patch from V_9_0 branch
upstream: clear io_want/io_ready flags at start of poll() cycle;

avoids plausible spin during rekeying if channel io_want flags are reused
across cycles. ok markus@ deraadt@
2022-04-15 11:04:54 -04:00
Ed Maste fb5aabcb99 scp: switch to using the SFTP protocol by default
From upstream release notes https://www.openssh.com/txt/release-9.0

This release switches scp(1) from using the legacy scp/rcp protocol
to using the SFTP protocol by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

This creates one area of potential incompatibility: scp(1) when using
the SFTP protocol no longer requires this finicky and brittle quoting,
and attempts to use it may cause transfers to fail. We consider the
removal of the need for double-quoting shell characters in file names
to be a benefit and do not intend to introduce bug-compatibility for
legacy scp/rcp in scp(1) when using the SFTP protocol.

Another area of potential incompatibility relates to the use of remote
paths relative to other user's home directories, for example -
"scp host:~user/file /tmp". The SFTP protocol has no native way to
expand a ~user path. However, sftp-server(8) in OpenSSH 8.7 and later
support a protocol extension "expand-path@openssh.com" to support
this.

In case of incompatibility, the scp(1) client may be instructed to use
the legacy scp/rcp using the -O flag.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2022-04-15 10:47:28 -04:00
Ed Maste 87c1498d1a ssh: update to OpenSSH v9.0p1
Release notes are available at https://www.openssh.com/txt/release-9.0

Some highlights:

 * ssh(1), sshd(8): use the hybrid Streamlined NTRU Prime + x25519 key
   exchange method by default ("sntrup761x25519-sha512@openssh.com").
   The NTRU algorithm is believed to resist attacks enabled by future
   quantum computers and is paired with the X25519 ECDH key exchange
   (the previous default) as a backstop against any weaknesses in
   NTRU Prime that may be discovered in the future. The combination
   ensures that the hybrid exchange offers at least as good security
   as the status quo.

 * sftp-server(8): support the "copy-data" extension to allow server-
   side copying of files/data, following the design in
   draft-ietf-secsh-filexfer-extensions-00. bz2948

 * sftp(1): add a "cp" command to allow the sftp client to perform
   server-side file copies.

This commit excludes the scp(1) change to use the SFTP protocol by
default; that change will immediately follow.

MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2022-04-15 10:41:08 -04:00
Ed Maste 58def461e2 ssh: update with post-release V_8_9 branch commits
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2022-04-13 16:53:20 -04:00
Ed Maste 1323ec5712 ssh: update to OpenSSH v8.9p1
Release notes are available at https://www.openssh.com/txt/release-8.9

Some highlights:

 * ssh(1), sshd(8), ssh-add(1), ssh-agent(1): add a system for
   restricting forwarding and use of keys added to ssh-agent(1)

 * ssh(1), sshd(8): add the sntrup761x25519-sha512@openssh.com hybrid
   ECDH/x25519 + Streamlined NTRU Prime post-quantum KEX to the
   default KEXAlgorithms list (after the ECDH methods but before the
   prime-group DH ones). The next release of OpenSSH is likely to
   make this key exchange the default method.

 * sshd(8), portable OpenSSH only: this release removes in-built
   support for MD5-hashed passwords. If you require these on your
   system then we recommend linking against libxcrypt or similar.

Future deprecation notice
=========================

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2022-04-13 16:00:56 -04:00
Jung-uk Kim 5ac766ab8e OpenSSL: Merge OpenSSL 1.1.1n 2022-03-15 19:37:45 -04:00
Jung-uk Kim d6d3d40098 Import OpenSSL 1.1.1n 2022-03-15 18:18:15 -04:00
Gordon Tetlow fdc418f15e Fix a bug in BN_mod_sqrt() that can cause it to loop forever.
Obtained from:	OpenSSL Project
Security:	CVE-2022-0778
2022-03-15 09:48:59 -07:00
Ed Maste cea0d3689e ssh: update sshd_config(5) for RSA/SHA-1 signature removal
OpenSSH 8.8p1 removed RSA/SHA-1 signatures by default, but failed to
update sshd_config(5).  It was updated upstream after the release in
b711bc01a7ec and da4035523406.

Fixes:		8c22023ca5 ("ssh: disable RSA/SHA-1 signatures")
Sponsored by:	The FreeBSD Foundation
2022-03-08 16:56:56 -05:00
Ed Maste 822d379b1f ssh: regen sk_config.h after 73104d5838 2022-03-05 20:00:04 -05:00