Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/OPENSSH]: src/crypto/external/bsd/openssh/dist Import OpenSSH 9.3 + the ...



details:   https://anonhg.NetBSD.org/src/rev/3e1d002ef79b
branches:  OPENSSH
changeset: 378208:3e1d002ef79b
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 26 17:31:29 2023 +0000

description:
Import OpenSSH 9.3 + the fix from p2 for the PKCS#11 remote provider
The previous version was OpenSSH 9.1

OpenSSH 9.3p2 (2023-07-19)
OpenSSH 9.3p2 was released on 2023-07-19. It is available from the
mirrors listed at https://www.openssh.com/.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
https://www.openssh.com/donations.html

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.

Checksums:
==========

- SHA1 (openssh-9.3p2.tar.gz) = 219cf700c317f400bb20b001c0406056f7188ea4
- SHA256 (openssh-9.3p2.tar.gz) = IA6+FH9ss/EB/QzfngJEKvfdyimN/9n0VoeOfMrGdug=

Please note that the SHA256 signatures are base64 encoded and not
hexadecimal (which is the default for most checksum tools). The PGP
key used to sign the releases is available from the mirror sites:
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

Reporting Bugs:
===============

- Please read https://www.openssh.com/report.html
  Security bugs should be reported directly to openssh%openssh.com@localhost


OpenSSH 9.3/9.3p1 (2023-03-15)
OpenSSH 9.3 was released on 2023-03-15. It is available from the
mirrors listed at https://www.openssh.com/.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
https://www.openssh.com/donations.html

Changes since OpenSSH 9.2
=========================

This release fixes a number of security bugs.

Security
========

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.

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

 * ssh-keygen(1), ssh-keyscan(1): accept -Ohashalg=sha1|sha256 when
   outputting SSHFP fingerprints to allow algorithm selection. bz3493

 * sshd(8): add a `sshd -G` option that parses and prints the
   effective configuration without attempting to load private keys
   and perform other checks. This allows usage of the option before
   keys have been generated and for configuration evaluation and
   verification by unprivileged users.

Bugfixes
--------

 * scp(1), sftp(1): fix progressmeter corruption on wide displays;
   bz3534

 * ssh-add(1), ssh-keygen(1): use RSA/SHA256 when testing usability
   of private keys as some systems are starting to disable RSA/SHA1
   in libcrypto.

 * sftp-server(8): fix a memory leak. GHPR363

 * ssh(1), sshd(8), ssh-keyscan(1): remove vestigal protocol
   compatibility code and simplify what's left.

 * Fix a number of low-impact Coverity static analysis findings.
   These include several reported via bz2687

 * ssh_config(5), sshd_config(5): mention that some options are not
   first-match-wins.

 * Rework logging for the regression tests. Regression tests will now
   capture separate logs for each ssh and sshd invocation in a test.

 * ssh(1): make `ssh -Q CASignatureAlgorithms` work as the manpage
   says it should; bz3532.

 * ssh(1): ensure that there is a terminating newline when adding a
   new entry to known_hosts; bz3529

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

 * sshd(8): harden Linux seccomp sandbox. Move to an allowlist of
   mmap(2), madvise(2) and futex(2) flags, removing some concerning
   kernel attack surface.

 * sshd(8): improve Linux seccomp-bpf sandbox for older systems;
   bz3537

Checksums:
==========

- SHA1 (openssh-9.3.tar.gz) = 5f9d2f73ddfe94f3f0a78bdf46704b6ad7b66ec7
- SHA256 (openssh-9.3.tar.gz) = eRcXkFZByz70DUBUcyIdvU0pVxP2X280FrmV8pyUdrk=

- SHA1 (openssh-9.3p1.tar.gz) = 610959871bf8d6baafc3525811948f85b5dd84ab
- SHA256 (openssh-9.3p1.tar.gz) = 6bq6dwGnalHz2Fpiw4OjydzZf6kAuFm8fbEUwYaK+Kg=

Please note that the SHA256 signatures are base64 encoded and not
hexadecimal (which is the default for most checksum tools). The PGP
key used to sign the releases is available from the mirror sites:
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

Reporting Bugs:
===============

- Please read https://www.openssh.com/report.html
  Security bugs should be reported directly to openssh%openssh.com@localhost


OpenSSH 9.2/9.2p1 (2023-02-02)
OpenSSH 9.2 was released on 2023-02-02. It is available from the
mirrors listed at https://www.openssh.com/.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
https://www.openssh.com/donations.html

Changes since OpenSSH 9.1
=========================

This release fixes a number of security bugs.

Security
========

This release contains fixes for two security problems 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.

 * sshd(8): fix a pre-authentication double-free memory fault
   introduced in OpenSSH 9.1. This is not believed to be exploitable,
   and it occurs in the unprivileged pre-auth process that is
   subject to chroot(2) and is further sandboxed on most major
   platforms.

 * ssh(8): in OpenSSH releases after 8.7, the PermitRemoteOpen option
   would ignore its first argument unless it was one of the special
   keywords "any" or "none", causing the permission list to fail open
   if only one permission was specified. bz3515

 * ssh(1): if the CanonicalizeHostname and CanonicalizePermittedCNAMEs
   options were enabled, and the system/libc resolver did not check
   that names in DNS responses were valid, then use of these options
   could allow an attacker with control of DNS to include invalid
   characters (possibly including wildcards) in names added to
   known_hosts files when they were updated. These names would still
   have to match the CanonicalizePermittedCNAMEs allow-list, so
   practical exploitation appears unlikely.

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

 * 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.

   This option defaults to "no", disabling the ~C command-line that
   was previously enabled by default. Turning off the command-line
   allows platforms that support sandboxing of the ssh(1) client
   (currently only OpenBSD) to use a stricter default sandbox policy.

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

 * 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.

 * ssh(1): add a "Host" line to the output of ssh -G showing the
   original hostname argument. bz3343

 * 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

Bugfixes
--------

 * ssh(1): when restoring non-blocking mode to stdio fds, restore
   exactly the flags that ssh started with and don't just clobber them
   with zero, as this could also remove the append flag from the set.
   bz3523

 * ssh(1): avoid printf("%s", NULL) if using UserKnownHostsFile=none
   and a hostkey in one of the system known hosts file changes.

 * scp(1): switch scp from using pipes to a socket-pair for
   communication with its ssh sub-processes, matching how sftp(1)
   operates.

 * sshd(8): clear signal mask early in main(); sshd may have been
   started with one or more signals masked (sigprocmask(2) is not
   cleared on fork/exec) and this could interfere with various things,
   e.g. the login grace timer. Execution environments that fail to
   clear the signal mask before running sshd are clearly broken, but
   apparently they do exist.

 * ssh(1): warn if no host keys for hostbased auth can be loaded.

 * sshd(8): Add server debugging for hostbased auth that is queued and
   sent to the client after successful authentication, but also logged
   to assist in diagnosis of HostbasedAuthentication problems. bz3507

 * ssh(1): document use of the IdentityFile option as being usable to
   list public keys as well as private keys. GHPR352

 * sshd(8): check for and disallow MaxStartups values less than or
   equal to zero during config parsing, rather than failing later at
   runtime.  bz3489

 * ssh-keygen(1): fix parsing of hex cert expiry times specified on
   the command-line when acting as a CA.

 * scp(1): when scp(1) is using the SFTP protocol for transport (the
   default), better match scp/rcp's handling of globs that don't match
   the globbed characters but do match literally (e.g. trying to
   transfer a file named "foo.[1]"). Previously scp(1) in SFTP mode
   would not match these pathnames but legacy scp/rcp mode would.
   bz3488

 * ssh-agent(1): document the "-O no-restrict-websafe" command-line
   option.

 * ssh(1): honour user's umask(2) if it is more restrictive then the
   ssh default (022).

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

 * sshd(8): allow writev(2) in the Linux seccomp sandbox. This seems
   to be used by recent glibcs at least in some configurations during
   error conditions. bz3512.

 * sshd(8): simply handling of SSH_CONNECTION PAM env var, removing
   global variable and checking the return value from pam_putenv.
   bz3508

 * sshd(8): disable SANDBOX_SECCOMP_FILTER_DEBUG that was mistakenly
   enabled during the OpenSSH 9.1 release cycle.

 * misc: update autotools and regenerate the config files using the
   latest autotools

 * all: use -fzero-call-used-regs=used on clang 15 instead of
   -fzero-call-used-reg=all, as some versions of clang 15 have
   miscompile code when it was enabled. bz3475

 * sshd(8): defer PRNG seeding until after the initial closefrom(2)
   call. PRNG seeding will initialize OpenSSL, and some engine
   providers (e.g. Intel's QAT) will open descriptors for their own
   use that closefrom(2) could clobber. bz3483

 * misc: in the poll(2)/ppoll(2) compatibility code, avoid assuming
   the layout of fd_set.

 * sftp-server(8), ssh-agent(1): fix ptrace(2) disabling on older
   FreeBSD kernels. Some versions do not support using id 0 to refer
   to the current PID for procctl, so try again with getpid()
   explicitly before failing.

 * configure.ac: fix -Wstrict-prototypes in configure test code.
   Clang 16 now warns on this and legacy prototypes will be removed
   in C23. GHPR355

 * configure.ac: fix setres*id checks to work with clang-16. glibc
   has the prototypes for setresuid behind _GNU_SOURCE, and clang 16
   will error out on implicit function definitions. bz3497

Checksums:
==========

- SHA1 (openssh-9.2.tar.gz) = e4b806b7c81b87d6c90afe97b3d016ba6cf3ba1c
- SHA256 (openssh-9.2.tar.gz) = yYe9uaaWSeetXGXOxuaaEiIsLnvITmGW+l5dgMZb9QU=

- SHA1 (openssh-9.2p1.tar.gz) = 3b172b8e971773a7018bbf3231f6589ae539ca4b
- SHA256 (openssh-9.2p1.tar.gz) = P2bb8WVftF9Q4cVtpiqwEhjCKIB7ITONY068351xz0Y=

Please note that the SHA256 signatures are base64 encoded and not
hexadecimal (which is the default for most checksum tools). The PGP
key used to sign the releases is available from the mirror sites:
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

Reporting Bugs:
===============

- Please read https://www.openssh.com/report.html
  Security bugs should be reported directly to openssh%openssh.com@localhost

diffstat:

 crypto/external/bsd/openssh/dist/PROTOCOL               |     4 +-
 crypto/external/bsd/openssh/dist/addr.c                 |    73 +-
 crypto/external/bsd/openssh/dist/addr.h                 |     4 +
 crypto/external/bsd/openssh/dist/auth-rhosts.c          |     4 +-
 crypto/external/bsd/openssh/dist/auth.c                 |    12 +-
 crypto/external/bsd/openssh/dist/auth2-hostbased.c      |     9 +-
 crypto/external/bsd/openssh/dist/auth2-none.c           |     3 +-
 crypto/external/bsd/openssh/dist/auth2-pubkey.c         |     8 +-
 crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c     |     3 +-
 crypto/external/bsd/openssh/dist/auth2.c                |     5 +-
 crypto/external/bsd/openssh/dist/authfd.c               |     9 +-
 crypto/external/bsd/openssh/dist/authfile.c             |     4 +-
 crypto/external/bsd/openssh/dist/canohost.c             |     5 +-
 crypto/external/bsd/openssh/dist/channels.c             |   286 +-
 crypto/external/bsd/openssh/dist/channels.h             |    26 +-
 crypto/external/bsd/openssh/dist/clientloop.c           |   181 +-
 crypto/external/bsd/openssh/dist/compat.c               |    67 +-
 crypto/external/bsd/openssh/dist/compat.h               |    14 +-
 crypto/external/bsd/openssh/dist/crypto_api.h           |     4 +-
 crypto/external/bsd/openssh/dist/dispatch.c             |     3 +-
 crypto/external/bsd/openssh/dist/dns.c                  |     8 +-
 crypto/external/bsd/openssh/dist/dns.h                  |     4 +-
 crypto/external/bsd/openssh/dist/ed25519.c              |  2047 ++++++++++++++-
 crypto/external/bsd/openssh/dist/ed25519.sh             |   119 +
 crypto/external/bsd/openssh/dist/hostfile.c             |    15 +-
 crypto/external/bsd/openssh/dist/kex.c                  |    76 +-
 crypto/external/bsd/openssh/dist/kex.h                  |     5 +-
 crypto/external/bsd/openssh/dist/kexgexs.c              |     3 +-
 crypto/external/bsd/openssh/dist/krl.c                  |     3 +-
 crypto/external/bsd/openssh/dist/misc.c                 |   100 +-
 crypto/external/bsd/openssh/dist/misc.h                 |    14 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.2048 |   142 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.3072 |   147 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.4096 |   134 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.6144 |   149 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.7680 |   129 +-
 crypto/external/bsd/openssh/dist/moduli-gen/moduli.8192 |   140 +-
 crypto/external/bsd/openssh/dist/moduli.c               |    13 +-
 crypto/external/bsd/openssh/dist/monitor.c              |     7 +-
 crypto/external/bsd/openssh/dist/monitor_wrap.c         |     3 +-
 crypto/external/bsd/openssh/dist/mux.c                  |     8 +-
 crypto/external/bsd/openssh/dist/packet.c               |     4 +-
 crypto/external/bsd/openssh/dist/progressmeter.c        |    95 +-
 crypto/external/bsd/openssh/dist/readconf.c             |    83 +-
 crypto/external/bsd/openssh/dist/readconf.h             |     4 +-
 crypto/external/bsd/openssh/dist/scp.1                  |    29 +-
 crypto/external/bsd/openssh/dist/scp.c                  |   147 +-
 crypto/external/bsd/openssh/dist/servconf.c             |   151 +-
 crypto/external/bsd/openssh/dist/servconf.h             |     9 +-
 crypto/external/bsd/openssh/dist/serverloop.c           |   101 +-
 crypto/external/bsd/openssh/dist/session.c              |    29 +-
 crypto/external/bsd/openssh/dist/session.h              |     4 +-
 crypto/external/bsd/openssh/dist/sftp-client.c          |    26 +-
 crypto/external/bsd/openssh/dist/sftp-glob.c            |    34 +-
 crypto/external/bsd/openssh/dist/sftp-server.c          |     6 +-
 crypto/external/bsd/openssh/dist/sftp.1                 |    18 +-
 crypto/external/bsd/openssh/dist/sftp.c                 |    48 +-
 crypto/external/bsd/openssh/dist/sntrup761.c            |    44 +-
 crypto/external/bsd/openssh/dist/sntrup761.sh           |     5 +-
 crypto/external/bsd/openssh/dist/ssh-add.c              |     9 +-
 crypto/external/bsd/openssh/dist/ssh-agent.1            |    48 +-
 crypto/external/bsd/openssh/dist/ssh-agent.c            |    36 +-
 crypto/external/bsd/openssh/dist/ssh-dss.c              |   285 +-
 crypto/external/bsd/openssh/dist/ssh-ecdsa-sk.c         |   171 +-
 crypto/external/bsd/openssh/dist/ssh-ecdsa.c            |   316 ++-
 crypto/external/bsd/openssh/dist/ssh-ed25519-sk.c       |   139 +-
 crypto/external/bsd/openssh/dist/ssh-ed25519.c          |   181 +-
 crypto/external/bsd/openssh/dist/ssh-keygen.1           |    19 +-
 crypto/external/bsd/openssh/dist/ssh-keygen.c           |    47 +-
 crypto/external/bsd/openssh/dist/ssh-keyscan.1          |    39 +-
 crypto/external/bsd/openssh/dist/ssh-keyscan.c          |    66 +-
 crypto/external/bsd/openssh/dist/ssh-pkcs11.c           |     8 +-
 crypto/external/bsd/openssh/dist/ssh-rsa.c              |   353 ++-
 crypto/external/bsd/openssh/dist/ssh-sk-helper.c        |     3 +-
 crypto/external/bsd/openssh/dist/ssh-xmss.c             |   228 +-
 crypto/external/bsd/openssh/dist/ssh.1                  |     5 +-
 crypto/external/bsd/openssh/dist/ssh.c                  |    49 +-
 crypto/external/bsd/openssh/dist/ssh_config.5           |    21 +-
 crypto/external/bsd/openssh/dist/sshbuf.c               |    25 +-
 crypto/external/bsd/openssh/dist/sshbuf.h               |    26 +-
 crypto/external/bsd/openssh/dist/sshconnect.c           |    25 +-
 crypto/external/bsd/openssh/dist/sshconnect2.c          |    81 +-
 crypto/external/bsd/openssh/dist/sshd.8                 |    22 +-
 crypto/external/bsd/openssh/dist/sshd.c                 |   104 +-
 crypto/external/bsd/openssh/dist/sshd_config.5          |   116 +-
 crypto/external/bsd/openssh/dist/sshkey-xmss.c          |     4 +-
 crypto/external/bsd/openssh/dist/sshkey-xmss.h          |     4 +-
 crypto/external/bsd/openssh/dist/sshkey.c               |  1984 +++-----------
 crypto/external/bsd/openssh/dist/sshkey.h               |    82 +-
 crypto/external/bsd/openssh/dist/umac.c                 |     5 +-
 crypto/external/bsd/openssh/dist/version.h              |     4 +-
 91 files changed, 6324 insertions(+), 3008 deletions(-)

diffs (truncated from 13939 to 300 lines):

diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/PROTOCOL
--- a/crypto/external/bsd/openssh/dist/PROTOCOL Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/PROTOCOL Wed Jul 26 17:31:29 2023 +0000
@@ -637,7 +637,7 @@ https://datatracker.ietf.org/doc/html/dr
 
 4.12. sftp: Extension request "users-groups-by-id%openssh.com@localhost"
 
-This request asks the server to returns user and/or group names that
+This request asks the server to return user and/or group names that
 correspond to one or more IDs (e.g. as returned from a SSH_FXP_STAT
 request). This may be used by the client to provide usernames in
 directory listings.
@@ -712,4 +712,4 @@ 5.5. Agent protocol extensions
 OpenSSH extends the usual agent protocol. These changes are documented
 in the PROTOCOL.agent file.
 
-$OpenBSD: PROTOCOL,v 1.47 2022/09/19 10:40:52 djm Exp $
+$OpenBSD: PROTOCOL,v 1.48 2022/11/07 01:53:01 dtucker Exp $
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/addr.c
--- a/crypto/external/bsd/openssh/dist/addr.c   Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/addr.c   Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: addr.c,v 1.5 2022/04/29 04:55:07 djm Exp $ */
+/* $OpenBSD: addr.c,v 1.6 2022/10/28 02:29:34 djm Exp $ */
 
 /*
  * Copyright (c) 2004-2008 Damien Miller <djm%mindrot.org@localhost>
@@ -224,6 +224,28 @@ addr_and(struct xaddr *dst, const struct
 }
 
 int
+addr_or(struct xaddr *dst, const struct xaddr *a, const struct xaddr *b)
+{
+       int i;
+
+       if (dst == NULL || a == NULL || b == NULL || a->af != b->af)
+               return (-1);
+
+       memcpy(dst, a, sizeof(*dst));
+       switch (a->af) {
+       case AF_INET:
+               dst->v4.s_addr |= b->v4.s_addr;
+               return (0);
+       case AF_INET6:
+               for (i = 0; i < 4; i++)
+                       dst->addr32[i] |= b->addr32[i];
+               return (0);
+       default:
+               return (-1);
+       }
+}
+
+int
 addr_cmp(const struct xaddr *a, const struct xaddr *b)
 {
        int i;
@@ -274,6 +296,29 @@ addr_is_all0s(const struct xaddr *a)
        }
 }
 
+/* Increment the specified address. Note, does not do overflow checking */
+void
+addr_increment(struct xaddr *a)
+{
+       int i;
+       uint32_t n;
+
+       switch (a->af) {
+       case AF_INET:
+               a->v4.s_addr = htonl(ntohl(a->v4.s_addr) + 1);
+               break;
+       case AF_INET6:
+               for (i = 0; i < 4; i++) {
+                       /* Increment with carry */
+                       n = ntohl(a->addr32[3 - i]) + 1;
+                       a->addr32[3 - i] = htonl(n);
+                       if (n != 0)
+                               break;
+               }
+               break;
+       }
+}
+
 /*
  * Test whether host portion of address 'a', as determined by 'masklen'
  * is all zeros.
@@ -293,6 +338,32 @@ addr_host_is_all0s(const struct xaddr *a
        return addr_is_all0s(&tmp_result);
 }
 
+#if 0
+int
+addr_host_to_all0s(struct xaddr *a, u_int masklen)
+{
+       struct xaddr tmp_mask;
+
+       if (addr_netmask(a->af, masklen, &tmp_mask) == -1)
+               return (-1);
+       if (addr_and(a, a, &tmp_mask) == -1)
+               return (-1);
+       return (0);
+}
+#endif
+
+int
+addr_host_to_all1s(struct xaddr *a, u_int masklen)
+{
+       struct xaddr tmp_mask;
+
+       if (addr_hostmask(a->af, masklen, &tmp_mask) == -1)
+               return (-1);
+       if (addr_or(a, a, &tmp_mask) == -1)
+               return (-1);
+       return (0);
+}
+
 /*
  * Parse string address 'p' into 'n'.
  * Returns 0 on success, -1 on failure.
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/addr.h
--- a/crypto/external/bsd/openssh/dist/addr.h   Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/addr.h   Wed Jul 26 17:31:29 2023 +0000
@@ -52,9 +52,13 @@ int addr_sa_pton(const char *h, const ch
 int addr_pton_cidr(const char *p, struct xaddr *n, u_int *l);
 int addr_ntop(const struct xaddr *n, char *p, size_t len);
 int addr_and(struct xaddr *dst, const struct xaddr *a, const struct xaddr *b);
+int addr_or(struct xaddr *dst, const struct xaddr *a, const struct xaddr *b);
 int addr_cmp(const struct xaddr *a, const struct xaddr *b);
 int addr_is_all0s(const struct xaddr *n);
 int addr_host_is_all0s(const struct xaddr *n, u_int masklen);
+int addr_host_to_all0s(struct xaddr *a, u_int masklen);
+int addr_host_to_all1s(struct xaddr *a, u_int masklen);
 int addr_netmatch(const struct xaddr *host, const struct xaddr *net,
     u_int masklen);
+void addr_increment(struct xaddr *a);
 #endif /* _ADDR_H */
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth-rhosts.c
--- a/crypto/external/bsd/openssh/dist/auth-rhosts.c    Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth-rhosts.c    Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rhosts.c,v 1.56 2022/02/23 21:21:49 djm Exp $ */
+/* $OpenBSD: auth-rhosts.c,v 1.57 2022/12/09 00:17:40 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
  * Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
@@ -17,6 +17,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include <errno.h>
 #include <fcntl.h>
 #include <netgroup.h>
 #include <pwd.h>
@@ -279,6 +280,7 @@ auth_rhosts2(struct passwd *pw, const ch
                xasprintf(&path, "%s/%s",
                    pw->pw_dir, rhosts_files[rhosts_file_index]);
                if (stat(path, &st) == -1) {
+                       debug3_f("stat %s: %s", path, strerror(errno));
                        free(path);
                        continue;
                }
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth.c
--- a/crypto/external/bsd/openssh/dist/auth.c   Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth.c   Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.158 2022/06/03 04:47:21 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.160 2023/03/05 05:34:09 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -62,7 +62,6 @@
 #include "authfile.h"
 #include "monitor_wrap.h"
 #include "ssherr.h"
-#include "compat.h"
 #include "channels.h"
 
 /* import */
@@ -500,14 +499,13 @@ auth_debug_add(const char *fmt,...)
        va_list args;
        int r;
 
-       if (auth_debug == NULL)
-               return;
-
        va_start(args, fmt);
        vsnprintf(buf, sizeof(buf), fmt, args);
        va_end(args);
-       if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0)
-               fatal_fr(r, "sshbuf_put_cstring");
+       debug3("%s", buf);
+       if (auth_debug != NULL)
+               if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0)
+                       fatal_fr(r, "sshbuf_put_cstring");
 }
 
 void
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth2-hostbased.c
--- a/crypto/external/bsd/openssh/dist/auth2-hostbased.c        Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth2-hostbased.c        Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-hostbased.c,v 1.50 2022/09/17 10:34:29 djm Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.52 2023/03/05 05:34:09 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -39,7 +39,6 @@
 #include "log.h"
 #include "misc.h"
 #include "servconf.h"
-#include "compat.h"
 #include "sshkey.h"
 #include "hostfile.h"
 #include "auth.h"
@@ -100,12 +99,6 @@ userauth_hostbased(struct ssh *ssh, cons
                    "(received %d, expected %d)", key->type, pktype);
                goto done;
        }
-       if (sshkey_type_plain(key->type) == KEY_RSA &&
-           (ssh->compat & SSH_BUG_RSASIGMD5) != 0) {
-               error("Refusing RSA key because peer uses unsafe "
-                   "signature format");
-               goto done;
-       }
        if (match_pattern_list(pkalg, options.hostbased_accepted_algos, 0) != 1) {
                logit_f("signature algorithm %s not in "
                    "HostbasedAcceptedAlgorithms", pkalg);
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth2-none.c
--- a/crypto/external/bsd/openssh/dist/auth2-none.c     Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth2-none.c     Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-none.c,v 1.24 2021/12/19 22:12:07 djm Exp $ */
+/* $OpenBSD: auth2-none.c,v 1.25 2023/03/05 05:34:09 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -35,7 +35,6 @@
 #include "log.h"
 #include "misc.h"
 #include "servconf.h"
-#include "compat.h"
 #include "ssh2.h"
 #include "ssherr.h"
 #ifdef GSSAPI
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth2-pubkey.c
--- a/crypto/external/bsd/openssh/dist/auth2-pubkey.c   Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth2-pubkey.c   Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-pubkey.c,v 1.117 2022/09/17 10:34:29 djm Exp $ */
+/* $OpenBSD: auth2-pubkey.c,v 1.118 2023/02/17 04:22:50 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2010 Damien Miller.  All rights reserved.
@@ -150,12 +150,6 @@ userauth_pubkey(struct ssh *ssh, const c
                    "(received %d, expected %d)", key->type, pktype);
                goto done;
        }
-       if (sshkey_type_plain(key->type) == KEY_RSA &&
-           (ssh->compat & SSH_BUG_RSASIGMD5) != 0) {
-               logit("Refusing RSA key because client uses unsafe "
-                   "signature scheme");
-               goto done;
-       }
        if (auth2_key_already_used(authctxt, key)) {
                logit("refusing previously-used %s key", sshkey_type(key));
                goto done;
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c
--- a/crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c       Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c       Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-pubkeyfile.c,v 1.3 2022/07/01 03:52:57 djm Exp $ */
+/* $OpenBSD: auth2-pubkeyfile.c,v 1.4 2023/03/05 05:34:09 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2010 Damien Miller.  All rights reserved.
@@ -41,7 +41,6 @@
 #include "ssh.h"
 #include "log.h"
 #include "misc.h"
-#include "compat.h"
 #include "sshkey.h"
 #include "digest.h"
 #include "hostfile.h"
diff -r 26af3c5d753e -r 3e1d002ef79b crypto/external/bsd/openssh/dist/auth2.c
--- a/crypto/external/bsd/openssh/dist/auth2.c  Wed Oct 05 22:35:32 2022 +0000
+++ b/crypto/external/bsd/openssh/dist/auth2.c  Wed Jul 26 17:31:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.164 2022/02/23 11:18:13 djm Exp $ */
+/* $OpenBSD: auth2.c,v 1.166 2023/03/08 04:43:12 guenther Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -44,7 +44,6 @@
 #include "sshbuf.h"
 #include "misc.h"
 #include "servconf.h"
-#include "compat.h"
 #include "sshkey.h"
 #include "hostfile.h"
 #include "auth.h"



Home | Main Index | Thread Index | Old Index