Am Tage des Herren Tue, 26 Aug 2025 19:05:06 GMT Ed Maste <ema...@freebsd.org> schrieb:
> The branch main has been updated by emaste: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=8e28d84935f2f0ee081d44f9803f3052b960e50b > > commit 8e28d84935f2f0ee081d44f9803f3052b960e50b > Merge: c553872b778e 9792a032f0a9 > Author: Ed Maste <ema...@freebsd.org> > AuthorDate: 2025-08-26 19:04:16 +0000 > Commit: Ed Maste <ema...@freebsd.org> > CommitDate: 2025-08-26 19:04:16 +0000 > > OpenSSH: Update to 10.0p2 > > Full release notes are available at > https://www.openssh.com/txt/release-10.0 > > Selected highlights from the release notes: > > Potentially-incompatible changes > > - This release removes support for the weak DSA signature algorithm. > [This change was previously merged to FreeBSD main.] > > - This release has the version number 10.0 and announces itself as > "SSH-2.0-OpenSSH_10.0". Software that naively matches versions using > patterns like "OpenSSH_1*" may be confused by this. > > - sshd(8): this release removes the code responsible for the user > authentication phase of the protocol from the per-connection > sshd-session binary to a new sshd-auth binary. > > Security > > - sshd(8): fix the DisableForwarding directive, which was failing to > disable X11 forwarding and agent forwarding as documented. > [This change was previously merged to FreeBSD main.] > > New features > > - ssh(1): the hybrid post-quantum algorithm mlkem768x25519-sha256 is now > used by default for key agreement. > > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D51630 > > crypto/openssh/.depend | 16 +- > crypto/openssh/.git_allowed_signers | 6 +- > crypto/openssh/.github/ci-status.md | 8 + > crypto/openssh/.github/configs | 31 +- > crypto/openssh/.github/run_test.sh | 22 +- > crypto/openssh/.github/setup_ci.sh | 13 + > crypto/openssh/.github/workflows/c-cpp.yml | 88 +- > crypto/openssh/.github/workflows/selfhosted.yml | 63 +- > crypto/openssh/.github/workflows/upstream.yml | 21 +- > crypto/openssh/.gitignore | 8 +- > crypto/openssh/.skipped-commit-ids | 2 + > crypto/openssh/ChangeLog | 9510 > +++++++++++--------- > crypto/openssh/INSTALL | 12 +- > crypto/openssh/Makefile.in | 65 +- > crypto/openssh/PROTOCOL.agent | 4 +- > crypto/openssh/PROTOCOL.certkeys | 15 +- > crypto/openssh/README | 20 +- > crypto/openssh/README.md | 4 +- > crypto/openssh/addr.c | 22 +- > crypto/openssh/addr.h | 11 - > crypto/openssh/auth2-pubkey.c | 91 +- > crypto/openssh/auth2.c | 4 +- > crypto/openssh/authfile.c | 4 +- > crypto/openssh/buildpkg.sh.in | 20 +- > crypto/openssh/channels.c | 40 +- > crypto/openssh/channels.h | 3 +- > crypto/openssh/cipher.c | 28 +- > crypto/openssh/clientloop.c | 7 +- > crypto/openssh/config.h | 27 +- > crypto/openssh/configure.ac | 145 +- > crypto/openssh/contrib/cygwin/ssh-user-config | 2 +- > crypto/openssh/contrib/redhat/openssh.spec | 30 +- > crypto/openssh/contrib/suse/openssh.spec | 2 +- > crypto/openssh/defines.h | 30 +- > crypto/openssh/dh.c | 8 +- > crypto/openssh/groupaccess.c | 2 +- > crypto/openssh/includes.h | 3 + > crypto/openssh/libcrux_mlkem768_sha3.h | 8 +- > crypto/openssh/log.c | 174 +- > crypto/openssh/log.h | 26 +- > crypto/openssh/loginrec.c | 76 +- > crypto/openssh/loginrec.h | 3 + > crypto/openssh/mdoc2man.awk | 4 +- > crypto/openssh/misc.c | 5 +- > crypto/openssh/mlkem768.sh | 10 +- > crypto/openssh/moduli | 844 +- > crypto/openssh/monitor.c | 111 +- > crypto/openssh/monitor.h | 3 + > crypto/openssh/monitor_wrap.c | 84 +- > crypto/openssh/monitor_wrap.h | 6 + > crypto/openssh/mux.c | 3 +- > crypto/openssh/myproposal.h | 14 +- > crypto/openssh/openbsd-compat/bsd-pselect.c | 106 +- > crypto/openssh/openbsd-compat/openssl-compat.h | 4 +- > crypto/openssh/openbsd-compat/port-linux.c | 13 + > crypto/openssh/openbsd-compat/port-linux.h | 4 + > crypto/openssh/pathnames.h | 3 + > crypto/openssh/platform-listen.c | 17 + > crypto/openssh/platform.h | 1 + > crypto/openssh/progressmeter.c | 3 +- > crypto/openssh/readconf.c | 122 +- > crypto/openssh/readconf.h | 9 +- > crypto/openssh/regress/Makefile | 3 +- > crypto/openssh/regress/agent-restrict.sh | 6 +- > crypto/openssh/regress/agent.sh | 27 +- > crypto/openssh/regress/cert-userkey.sh | 62 +- > crypto/openssh/regress/cfginclude.sh | 14 +- > crypto/openssh/regress/cfgmatch.sh | 70 +- > crypto/openssh/regress/dropbear-ciphers.sh | 4 +- > crypto/openssh/regress/dropbear-kex.sh | 17 +- > crypto/openssh/regress/hostkey-agent.sh | 28 +- > crypto/openssh/regress/key-options.sh | 7 +- > .../regress/misc/fuzz-harness/agent_fuzz_helper.c | 1 + > crypto/openssh/regress/misc/sk-dummy/Makefile | 66 + > .../regress/misc/ssh-verify-attestation/Makefile | 79 + > .../ssh-verify-attestation.c | 433 + > crypto/openssh/regress/percent.sh | 42 +- > crypto/openssh/regress/servcfginclude.sh | 14 +- > crypto/openssh/regress/sftp-resume.sh | 43 + > crypto/openssh/regress/sshfp-connect.sh | 8 +- > crypto/openssh/regress/test-exec.sh | 27 +- > crypto/openssh/regress/unittests/authopt/Makefile | 27 + > crypto/openssh/regress/unittests/misc/Makefile | 33 + > crypto/openssh/sandbox-capsicum.c | 30 +- > crypto/openssh/sandbox-darwin.c | 17 +- > crypto/openssh/sandbox-null.c | 12 - > crypto/openssh/sandbox-pledge.c | 77 - > crypto/openssh/sandbox-rlimit.c | 17 +- > crypto/openssh/sandbox-seccomp-filter.c | 17 +- > crypto/openssh/sandbox-solaris.c | 14 - > crypto/openssh/sandbox-systrace.c | 218 - > crypto/openssh/scp.1 | 59 +- > crypto/openssh/scp.c | 5 +- > crypto/openssh/servconf.c | 69 +- > crypto/openssh/servconf.h | 1 + > crypto/openssh/serverloop.c | 5 +- > crypto/openssh/session.c | 11 +- > crypto/openssh/sftp-client.c | 3 +- > crypto/openssh/sftp.1 | 59 +- > crypto/openssh/sftp.c | 3 +- > crypto/openssh/sk-usbhid.c | 9 +- > crypto/openssh/srclimit.c | 2 +- > crypto/openssh/ssh-agent.1 | 62 +- > crypto/openssh/ssh-agent.c | 136 +- > crypto/openssh/ssh-ecdsa-sk.c | 2 +- > crypto/openssh/ssh-keygen.1 | 8 +- > crypto/openssh/ssh-keygen.c | 12 +- > crypto/openssh/ssh-keyscan.c | 19 +- > crypto/openssh/ssh-keysign.c | 4 +- > crypto/openssh/ssh-pkcs11.c | 6 +- > crypto/openssh/ssh-sandbox.h | 2 - > crypto/openssh/ssh.1 | 34 +- > crypto/openssh/ssh.c | 93 +- > crypto/openssh/ssh.h | 17 +- > crypto/openssh/ssh_api.c | 25 +- > crypto/openssh/ssh_config.5 | 105 +- > crypto/openssh/ssh_namespace.h | 11 +- > crypto/openssh/sshconnect.c | 5 +- > crypto/openssh/sshconnect.h | 14 +- > crypto/openssh/sshconnect2.c | 8 +- > crypto/openssh/sshd-auth.c | 888 ++ > crypto/openssh/sshd-debug.sh | 52 + > crypto/openssh/sshd-session.c | 334 +- > crypto/openssh/sshd.c | 402 +- > crypto/openssh/sshd_config | 4 +- > crypto/openssh/sshd_config.5 | 40 +- > crypto/openssh/sshkey.c | 18 +- > crypto/openssh/sshkey.h | 4 +- > crypto/openssh/sshsig.c | 13 +- > crypto/openssh/version.h | 6 +- > secure/libexec/Makefile | 1 + > secure/libexec/sshd-auth/Makefile | 58 + > secure/libexec/sshd-session/Makefile | 4 +- > 133 files changed, 9733 insertions(+), 6333 deletions(-) > > diff --cc crypto/openssh/.gitignore > index 41d505c46dde,000000000000..c419d0fd662b > mode 100644,000000..100644 > --- a/crypto/openssh/.gitignore > +++ b/crypto/openssh/.gitignore > @@@ -1,35 -1,0 +1,39 @@@ > +Makefile > +buildpkg.sh > +config.h > +config.h.in~ > +config.log > +config.status > +openbsd-compat/Makefile > +openbsd-compat/regress/Makefile > +openssh.xml > +opensshd.init > +survey.sh > +**/*.o > +**/*.lo > +**/*.so > ++**/*.dylib > ++**/*.dll > +**/*.out > +**/*.a > +**/*.un~ > +**/.*.swp > +autom4te.cache/ > +scp > +sftp > +sftp-server > +ssh > +ssh-add > +ssh-agent > +ssh-keygen > +ssh-keyscan > +ssh-keysign > +ssh-pkcs11-helper > +ssh-sk-helper > +sshd > - !regress/misc/fuzz-harness/Makefile > - !regress/unittests/sshsig/Makefile > ++sshd-session > ++sshd-auth > ++!regress/misc/**/Makefile > ++!regress/unittests/**/Makefile > +tags > + > diff --cc crypto/openssh/INSTALL > index adc6e0825738,000000000000..113c25cc2203 > mode 100644,000000..100644 > --- a/crypto/openssh/INSTALL > +++ b/crypto/openssh/INSTALL > @@@ -1,293 -1,0 +1,295 @@@ > +1. Prerequisites > +---------------- > + > +A C compiler. Any C89 or better compiler that supports variadic macros > +should work. Where supported, configure will attempt to enable the > +compiler's run-time integrity checking options. Some notes about > +specific compilers: > + - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime > + (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure) > + > +To support Privilege Separation (which is now required) you will need > +to create the user, group and directory used by sshd for privilege > +separation. See README.privsep for details. > + > + > +The remaining items are optional. > + > +A working installation of zlib: > +Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems): > +https://zlib.net/ > + > +libcrypto from either of LibreSSL or OpenSSL. Building without libcrypto > +is supported but severely restricts the available ciphers and algorithms. > + - LibreSSL (https://www.libressl.org/) 3.1.0 or greater > + - OpenSSL (https://www.openssl.org) 1.1.1 or greater > + > +LibreSSL/OpenSSL should be compiled as a position-independent library > +(i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC" > +or LibreSSL as "CFLAGS=-fPIC ./configure") otherwise OpenSSH will not > +be able to link with it. If you must use a non-position-independent > +libcrypto, then you may need to configure OpenSSH --without-pie. > + > +If you build either from source, running the OpenSSL self-test ("make > +tests") or the LibreSSL equivalent ("make check") and ensuring that all > +tests pass is strongly recommended. > + > +NB. If you operating system supports /dev/random, you should configure > +libcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's > +direct support of /dev/random, or failing that, either prngd or egd. > + > +PRNGD: > + > +If your system lacks kernel-based random collection, the use of Lutz > - Jaenicke's PRNGd is recommended. It requires that libcrypto be configured > - to support it. > ++Jaenicke's PRNGd is recommended. If you are using libcrypto it requires > ++that the libcrypto is configured to support it. If you are building > ++--without-openssl then the --with-prngd-socket option must match the > ++socket provided by prngd. > + > +http://prngd.sourceforge.net/ > + > +EGD: > + > +The Entropy Gathering Daemon (EGD) supports the same interface as prngd. > - It also supported only if libcrypto is configured to support it. > ++The same caveats about configuration for prngd also apply. > + > +http://egd.sourceforge.net/ > + > +PAM: > + > +OpenSSH can utilise Pluggable Authentication Modules (PAM) if your > +system supports it. PAM is standard most Linux distributions, Solaris, > +HP-UX 11, AIX >= 5.2, FreeBSD, NetBSD and Mac OS X. > + > +Information about the various PAM implementations are available: > + > +Solaris PAM: http://www.sun.com/software/solaris/pam/ > +Linux PAM: http://www.kernel.org/pub/linux/libs/pam/ > +OpenPAM: http://www.openpam.org/ > + > +If you wish to build the GNOME passphrase requester, you will need the GNOME > +libraries and headers. > + > +GNOME: > +http://www.gnome.org/ > + > +Alternatively, Jim Knoble <jmkno...@pobox.com> has written an excellent X11 > +passphrase requester. This is maintained separately at: > + > +http://www.jmknoble.net/software/x11-ssh-askpass/ > + > +TCP Wrappers: > + > +If you wish to use the TCP wrappers functionality you will need at least > +tcpd.h and libwrap.a, either in the standard include and library paths, > +or in the directory specified by --with-tcp-wrappers. Version 7.6 is > +known to work. > + > +http://ftp.porcupine.org/pub/security/index.html > + > +LibEdit: > + > +sftp supports command-line editing via NetBSD's libedit. If your platform > +has it available natively you can use that, alternatively you might try > +these multi-platform ports: > + > +http://www.thrysoee.dk/editline/ > +http://sourceforge.net/projects/libedit/ > + > +LDNS: > + > +LDNS is a DNS BSD-licensed resolver library which supports DNSSEC. > + > +http://nlnetlabs.nl/projects/ldns/ > + > +Autoconf: > + > +If you modify configure.ac or configure doesn't exist (eg if you checked > - the code out of git yourself) then you will need autoconf-2.69 and > - automake-1.16.1 to rebuild the automatically generated files by running > ++the main git branch) then you will need autoconf-2.69 and automake-1.16.1 > ++or newer to rebuild the automatically generated files by running > +"autoreconf". Earlier versions may also work but this is not guaranteed. > + > +http://www.gnu.org/software/autoconf/ > +http://www.gnu.org/software/automake/ > + > +Basic Security Module (BSM): > + > +Native BSM support is known to exist in Solaris from at least 2.5.1, > +FreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM > +implementation (http://www.openbsm.org). > + > +makedepend: > + > +https://www.x.org/archive/individual/util/ > + > +If you are making significant changes to the code you may need to rebuild > +the dependency (.depend) file using "make depend", which requires the > +"makedepend" tool from the X11 distribution. > + > +libfido2: > + > +libfido2 allows the use of hardware security keys over USB. libfido2 > +in turn depends on libcbor. libfido2 >= 1.5.0 is strongly recommended. > +Limited functionality is possible with earlier libfido2 versions. > + > +https://github.com/Yubico/libfido2 > +https://github.com/pjk/libcbor > + > + > +2. Building / Installation > +-------------------------- > + > +To install OpenSSH with default options: > + > +./configure > +make > +make install > + > +This will install the OpenSSH binaries in /usr/local/bin, configuration > files > +in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a > different > +installation prefix, use the --prefix option to configure: > + > +./configure --prefix=/opt > +make > +make install > + > +Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override > +specific paths, for example: > + > +./configure --prefix=/opt --sysconfdir=/etc/ssh > +make > +make install > + > +This will install the binaries in /opt/{bin,lib,sbin}, but will place the > +configuration files in /etc/ssh. > + > +If you are using PAM, you may need to manually install a PAM control > +file as "/etc/pam.d/sshd" (or wherever your system prefers to keep > +them). Note that the service name used to start PAM is __progname, > +which is the basename of the path of your sshd (e.g., the service name > +for /usr/sbin/osshd will be osshd). If you have renamed your sshd > +executable, your PAM configuration may need to be modified. > + > +A generic PAM configuration is included as "contrib/sshd.pam.generic", > +you may need to edit it before using it on your system. If you are > +using a recent version of Red Hat Linux, the config file in > +contrib/redhat/sshd.pam should be more useful. Failure to install a > +valid PAM file may result in an inability to use password > +authentication. On HP-UX 11 and Solaris, the standard /etc/pam.conf > +configuration will work with sshd (sshd will match the other service > +name). > + > +There are a few other options to the configure script: > + > +--with-audit=[module] enable additional auditing via the specified module. > +Currently, drivers for "debug" (additional info via syslog) and "bsm" > +(Sun's Basic Security Module) are supported. > + > +--with-pam enables PAM support. If PAM support is compiled in, it must > +also be enabled in sshd_config (refer to the UsePAM directive). > + > +--with-prngd-socket=/some/file allows you to enable EGD or PRNGD > +support and to specify a PRNGd socket. Use this if your Unix lacks > +/dev/random. > + > +--with-prngd-port=portnum allows you to enable EGD or PRNGD support > +and to specify a EGD localhost TCP port. Use this if your Unix lacks > +/dev/random. > + > +--with-lastlog=FILE will specify the location of the lastlog file. > +./configure searches a few locations for lastlog, but may not find > +it if lastlog is installed in a different place. > + > +--without-lastlog will disable lastlog support entirely. > + > +--with-osfsia, --without-osfsia will enable or disable OSF1's Security > +Integration Architecture. The default for OSF1 machines is enable. > + > +--with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny) > +support. > + > +--with-utmpx enables utmpx support. utmpx support is automatic for > +some platforms. > + > +--without-shadow disables shadow password support. > + > +--with-ipaddr-display forces the use of a numeric IP address in the > +$DISPLAY environment variable. Some broken systems need this. > + > +--with-default-path=PATH allows you to specify a default $PATH for sessions > +started by sshd. This replaces the standard path entirely. > + > +--with-pid-dir=PATH specifies the directory in which the sshd.pid file is > +created. > + > +--with-xauth=PATH specifies the location of the xauth binary > + > +--with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL > +libraries are installed. > + > +--with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support > + > +--without-openssl builds without using OpenSSL. Only a subset of ciphers > +and algorithms are supported in this configuration. > + > +--without-zlib builds without zlib. This disables the Compression option. > + > +--with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to > +real (AF_INET) IPv4 addresses. Works around some quirks on Linux. > + > +If you need to pass special options to the compiler or linker, you > +can specify these as environment variables before running ./configure. > +For example: > + > +CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure > + > +3. Configuration > +---------------- > + > +The runtime configuration files are installed by in ${prefix}/etc or > +whatever you specified as your --sysconfdir (/usr/local/etc by default). > + > +The default configuration should be instantly usable, though you should > +review it to ensure that it matches your security requirements. > + > +To generate a host key, run "make host-key". Alternately you can do so > +manually using the following commands: > + > + ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N "" > + > +for each of the types you wish to generate (rsa, dsa or ecdsa) or > + > + ssh-keygen -A > + > +to generate keys for all supported types. > + > +Replacing /etc/ssh with the correct path to the configuration directory. > +(${prefix}/etc or whatever you specified with --sysconfdir during > +configuration). > + > +If you have configured OpenSSH with EGD/prngd support, ensure that EGD or > +prngd is running and has collected some entropy first. > + > +For more information on configuration, please refer to the manual pages > +for sshd, ssh and ssh-agent. > + > +4. (Optional) Send survey > +------------------------- > + > +$ make survey > +[check the contents of the file "survey" to ensure there's no information > +that you consider sensitive] > +$ make send-survey > + > +This will send configuration information for the currently configured > +host to a survey address. This will help determine which configurations > +are actually in use, and what valid combinations of configure options > +exist. The raw data is available only to the OpenSSH developers, however > +summary data may be published. > + > +5. Problems? > +------------ > + > +If you experience problems compiling, installing or running OpenSSH, > +please refer to the "reporting bugs" section of the webpage at > +https://www.openssh.com/ > diff --cc crypto/openssh/README.md > index 9431b0ffdd89,000000000000..2ad6471386e2 > mode 100644,000000..100644 > --- a/crypto/openssh/README.md > +++ b/crypto/openssh/README.md > @@@ -1,86 -1,0 +1,86 @@@ > +# Portable OpenSSH > + > +[](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml) > +[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) > +[](https://scan.coverity.com/projects/openssh-portable) > + > +OpenSSH is a complete implementation of the SSH protocol (version 2) for > secure remote > login, command execution and file transfer. It includes a client ``ssh`` and > server > ``sshd``, file transfer utilities ``scp`` and ``sftp`` as well as tools for > key generation > (``ssh-keygen``), run-time key storage (``ssh-agent``) and a number of > supporting programs. > + +This is a port of OpenBSD's > [OpenSSH](https://openssh.com) to most Unix-like operating systems, including > Linux, OS X and Cygwin. Portable OpenSSH polyfills OpenBSD APIs that are not > available elsewhere, adds sshd sandboxing for more operating systems and > includes support for OS-native authentication and auditing (e.g. using PAM). > + +## Documentation + > +The official documentation for OpenSSH are the man pages for each tool: > + > +* [ssh(1)](https://man.openbsd.org/ssh.1) > +* [sshd(8)](https://man.openbsd.org/sshd.8) > +* [ssh-keygen(1)](https://man.openbsd.org/ssh-keygen.1) > +* [ssh-agent(1)](https://man.openbsd.org/ssh-agent.1) > +* [scp(1)](https://man.openbsd.org/scp.1) > +* [sftp(1)](https://man.openbsd.org/sftp.1) > +* [ssh-keyscan(8)](https://man.openbsd.org/ssh-keyscan.8) > +* [sftp-server(8)](https://man.openbsd.org/sftp-server.8) > + > +## Stable Releases > + > +Stable release tarballs are available from a number of [download > mirrors](https://www.openssh.com/portable.html#downloads). We recommend the > use of a stable release for most users. Please read the [release > notes](https://www.openssh.com/releasenotes.html) for details of recent > changes and potential incompatibilities. + > +## Building Portable OpenSSH > + > +### Dependencies > + > +Portable OpenSSH is built using autoconf and make. It requires a working C > compiler, > standard library and headers. + > +``libcrypto`` from either > [LibreSSL](https://www.libressl.org/) or [OpenSSL](https://www.openssl.org) > may also be used. OpenSSH may be built without either of these, but the > resulting binaries will have only a subset of the cryptographic algorithms > normally available. + > +[zlib](https://www.zlib.net/) is optional; without it transport compression > is not supported. > + > +FIDO security token support needs > [libfido2](https://github.com/Yubico/libfido2) and its dependencies and will > be enabled automatically if they are found. + > +In addition, certain platforms and build-time options may require > additional dependencies; > see README.platform for details about your platform. + > +### Building a release > + > - Releases include a pre-built copy of the ``configure`` script and may be > built using: > ++Release tarballs and release branches in git include a pre-built copy of > the ``configure`` > script and may be built using: + > +``` > +tar zxvf openssh-X.YpZ.tar.gz > +cd openssh > +./configure # [options] > +make && make tests > +``` > + > +See the [Build-time Customisation](#build-time-customisation) section below > for configure > options. If you plan on installing OpenSSH to your system, then you will > usually want to > specify destination paths. + +### Building from git > + > - If building from git, you'll need > [autoconf](https://www.gnu.org/software/autoconf/) installed to build the > ``configure`` script. The following commands will check out and build > portable OpenSSH from git: ++If building from the git master branch, you'll > need [autoconf](https://www.gnu.org/software/autoconf/) installed to build > the ``configure`` script. The following commands will check out and build > portable OpenSSH from git: > + > +``` > +git > clone https://github.com/openssh/openssh-portable # or > https://anongit.mindrot.org/openssh.git +cd openssh-portable > +autoreconf > +./configure > +make && make tests > +``` > + > +### Build-time Customisation > + > +There are many build-time customisation options available. All Autoconf > destination path > flags (e.g. ``--prefix``) are supported (and are usually required if you want > to install > OpenSSH). + +For a full list of available flags, run ``./configure --help`` > but a few of the > more frequently-used ones are described below. Some of these flags will > require additional > libraries and/or headers be installed. + +Flag | Meaning > +--- | --- > +``--with-pam`` | Enable > [PAM](https://en.wikipedia.org/wiki/Pluggable_authentication_module) support. > [OpenPAM](https://www.openpam.org/), [Linux PAM](http://www.linux-pam.org/) > and Solaris PAM are supported. +``--with-libedit`` | Enable > [libedit](https://www.thrysoee.dk/editline/) support for sftp. > +``--with-kerberos5`` | Enable Kerberos/GSSAPI support. Both > [Heimdal](https://www.h5l.org/) and [MIT](https://web.mit.edu/kerberos/) > Kerberos implementations are supported. +``--with-selinux`` | Enable > [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) support. > + > +## Development > + > +Portable OpenSSH development is discussed on the [openssh-unix-dev mailing > list](https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev) ([archive > mirror](https://marc.info/?l=openssh-unix-dev)). Bugs and feature requests > are tracked on our [Bugzilla](https://bugzilla.mindrot.org/). + > +## Reporting bugs > + > +_Non-security_ bugs may be reported to the developers via > [Bugzilla](https://bugzilla.mindrot.org/) or via the mailing list above. > Security bugs should be reported to > [open...@openssh.com](mailto:openssh.openssh.com). diff --cc > crypto/openssh/auth2.c > index 65a91062862c,000000000000..eac1d26a4aaf > mode 100644,000000..100644 > --- a/crypto/openssh/auth2.c > +++ b/crypto/openssh/auth2.c > @@@ -1,811 -1,0 +1,811 @@@ > - /* $OpenBSD: auth2.c,v 1.169 2024/05/17 00:30:23 djm Exp $ */ > ++/* $OpenBSD: auth2.c,v 1.170 2025/01/17 00:09:41 dtucker Exp $ */ > +/* > + * Copyright (c) 2000 Markus Friedl. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include "includes.h" > + > +#include <sys/types.h> > +#include <sys/stat.h> > +#include <sys/uio.h> > + > +#include <fcntl.h> > +#include <limits.h> > +#include <pwd.h> > +#include <stdarg.h> > +#include <string.h> > +#include <unistd.h> > +#include <time.h> > + > +#include "stdlib.h" > +#include "atomicio.h" > +#include "xmalloc.h" > +#include "ssh2.h" > +#include "packet.h" > +#include "log.h" > +#include "sshbuf.h" > +#include "misc.h" > +#include "servconf.h" > +#include "sshkey.h" > +#include "hostfile.h" > +#include "auth.h" > +#include "dispatch.h" > +#include "pathnames.h" > +#include "ssherr.h" > +#include "blacklist_client.h" > +#ifdef GSSAPI > +#include "ssh-gss.h" > +#endif > +#include "monitor_wrap.h" > +#include "digest.h" > +#include "kex.h" > + > +/* import */ > +extern ServerOptions options; > +extern struct sshbuf *loginmsg; > + > +/* methods */ > + > +extern Authmethod method_none; > +extern Authmethod method_pubkey; > +extern Authmethod method_passwd; > +extern Authmethod method_kbdint; > +extern Authmethod method_hostbased; > +#ifdef GSSAPI > +extern Authmethod method_gssapi; > +#endif > + > +Authmethod *authmethods[] = { > + &method_none, > + &method_pubkey, > +#ifdef GSSAPI > + &method_gssapi, > +#endif > + &method_passwd, > + &method_kbdint, > + &method_hostbased, > + NULL > +}; > + > +/* protocol */ > + > +static int input_service_request(int, u_int32_t, struct ssh *); > +static int input_userauth_request(int, u_int32_t, struct ssh *); > + > +/* helper */ > +static Authmethod *authmethod_byname(const char *); > +static Authmethod *authmethod_lookup(Authctxt *, const char *); > +static char *authmethods_get(Authctxt *authctxt); > + > +#define MATCH_NONE 0 /* method or submethod mismatch */ > +#define MATCH_METHOD 1 /* method matches (no submethod > specified) */ > +#define MATCH_BOTH 2 /* method and submethod match */ > +#define MATCH_PARTIAL 3 /* method matches, submethod can't be > checked */ > +static int list_starts_with(const char *, const char *, const char *); > + > +char * > +auth2_read_banner(void) > +{ > + struct stat st; > + char *banner = NULL; > + size_t len, n; > + int fd; > + > + if ((fd = open(options.banner, O_RDONLY)) == -1) > + return (NULL); > + if (fstat(fd, &st) == -1) { > + close(fd); > + return (NULL); > + } > + if (st.st_size <= 0 || st.st_size > 1*1024*1024) { > + close(fd); > + return (NULL); > + } > + > + len = (size_t)st.st_size; /* truncate */ > + banner = xmalloc(len + 1); > + n = atomicio(read, fd, banner, len); > + close(fd); > + > + if (n != len) { > + free(banner); > + return (NULL); > + } > + banner[n] = '\0'; > + > + return (banner); > +} > + > +static void > +userauth_send_banner(struct ssh *ssh, const char *msg) > +{ > + int r; > + > + if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_BANNER)) != 0 || > + (r = sshpkt_put_cstring(ssh, msg)) != 0 || > + (r = sshpkt_put_cstring(ssh, "")) != 0 || /* language, unused */ > + (r = sshpkt_send(ssh)) != 0) > + fatal_fr(r, "send packet"); > + debug("%s: sent", __func__); > +} > + > +static void > +userauth_banner(struct ssh *ssh) > +{ > + char *banner = NULL; > + > + if (options.banner == NULL) > + return; > + > + if ((banner = mm_auth2_read_banner()) == NULL) > + goto done; > + userauth_send_banner(ssh, banner); > + > +done: > + free(banner); > +} > + > +/* > + * loop until authctxt->success == TRUE > + */ > +void > +do_authentication2(struct ssh *ssh) > +{ > + Authctxt *authctxt = ssh->authctxt; > + > + ssh_dispatch_init(ssh, &dispatch_protocol_error); > + if (ssh->kex->ext_info_c) > + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &kex_input_ext_info); > + ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_REQUEST, &input_service_request); > + ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success); > + ssh->authctxt = NULL; > +} > + > +static int > +input_service_request(int type, u_int32_t seq, struct ssh *ssh) > +{ > + Authctxt *authctxt = ssh->authctxt; > + char *service = NULL; > + int r, acceptit = 0; > + > + if ((r = sshpkt_get_cstring(ssh, &service, NULL)) != 0 || > + (r = sshpkt_get_end(ssh)) != 0) > + goto out; > + > + if (authctxt == NULL) > + fatal("input_service_request: no authctxt"); > + > + if (strcmp(service, "ssh-userauth") == 0) { > + if (!authctxt->success) { > + acceptit = 1; > + /* now we can handle user-auth requests */ > + ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_REQUEST, > + &input_userauth_request); > + } > + } > + /* XXX all other service requests are denied */ > + > + if (acceptit) { > + if ((r = sshpkt_start(ssh, SSH2_MSG_SERVICE_ACCEPT)) != 0 || > + (r = sshpkt_put_cstring(ssh, service)) != 0 || > + (r = sshpkt_send(ssh)) != 0 || > + (r = ssh_packet_write_wait(ssh)) != 0) > + goto out; > + } else { > + debug("bad service request %s", service); > + ssh_packet_disconnect(ssh, "bad service request %s", service); > + } > + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &dispatch_protocol_error); > + r = 0; > + out: > + free(service); > + return r; > +} > + > +#define MIN_FAIL_DELAY_SECONDS 0.005 > +#define MAX_FAIL_DELAY_SECONDS 5.0 > +static double > +user_specific_delay(const char *user) > +{ > + char b[512]; > + size_t len = ssh_digest_bytes(SSH_DIGEST_SHA512); > + u_char *hash = xmalloc(len); > + double delay; > + > + (void)snprintf(b, sizeof b, "%llu%s", > + (unsigned long long)options.timing_secret, user); > + if (ssh_digest_memory(SSH_DIGEST_SHA512, b, strlen(b), hash, len) != 0) > + fatal_f("ssh_digest_memory"); > + /* 0-4.2 ms of delay */ > + delay = (double)PEEK_U32(hash) / 1000 / 1000 / 1000 / 1000; > + freezero(hash, len); > - debug3_f("user specific delay %0.3lfms", delay/1000); > ++ debug3_f("user specific delay %0.3lfms", delay*1000); > + return MIN_FAIL_DELAY_SECONDS + delay; > +} > + > +static void > +ensure_minimum_time_since(double start, double seconds) > +{ > + struct timespec ts; > + double elapsed = monotime_double() - start, req = seconds, remain; > + > + if (elapsed > MAX_FAIL_DELAY_SECONDS) { > + debug3_f("elapsed %0.3lfms exceeded the max delay " > + "requested %0.3lfms)", elapsed*1000, req*1000); > + return; > + } > + > + /* if we've already passed the requested time, scale up */ > + while ((remain = seconds - elapsed) < 0.0) > + seconds *= 2; > + > + ts.tv_sec = remain; > + ts.tv_nsec = (remain - ts.tv_sec) * 1000000000; > + debug3_f("elapsed %0.3lfms, delaying %0.3lfms (requested %0.3lfms)", > + elapsed*1000, remain*1000, req*1000); > + nanosleep(&ts, NULL); > +} > + > +static int > +input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) > +{ > + Authctxt *authctxt = ssh->authctxt; > + Authmethod *m = NULL; > + char *user = NULL, *service = NULL, *method = NULL, *style = NULL; > + int r, authenticated = 0; > + double tstart = monotime_double(); > + > + if (authctxt == NULL) > + fatal("input_userauth_request: no authctxt"); > + > + if ((r = sshpkt_get_cstring(ssh, &user, NULL)) != 0 || > + (r = sshpkt_get_cstring(ssh, &service, NULL)) != 0 || > + (r = sshpkt_get_cstring(ssh, &method, NULL)) != 0) > + goto out; > + debug("userauth-request for user %s service %s method %s", user, > service, method); > + debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); > + > + if ((style = strchr(user, ':')) != NULL) > + *style++ = 0; > + > + if (authctxt->attempt >= 1024) > + auth_maxtries_exceeded(ssh); > + if (authctxt->attempt++ == 0) { > + /* setup auth context */ > + authctxt->pw = mm_getpwnamallow(ssh, user); > + authctxt->user = xstrdup(user); > + if (authctxt->pw && strcmp(service, "ssh-connection")==0) { > + authctxt->valid = 1; > + debug2_f("setting up authctxt for %s", user); > + } else { > + authctxt->valid = 0; > + /* Invalid user, fake password information */ > + authctxt->pw = fakepw(); > +#ifdef SSH_AUDIT_EVENTS > + mm_audit_event(ssh, SSH_INVALID_USER); > +#endif > + } > +#ifdef USE_PAM > + if (options.use_pam) > + mm_start_pam(ssh); > +#endif > + ssh_packet_set_log_preamble(ssh, "%suser %s", > + authctxt->valid ? "authenticating " : "invalid ", user); > + setproctitle("%s [net]", authctxt->valid ? user : "unknown"); > + authctxt->service = xstrdup(service); > + authctxt->style = style ? xstrdup(style) : NULL; > + mm_inform_authserv(service, style); > + userauth_banner(ssh); > + if ((r = kex_server_update_ext_info(ssh)) != 0) > + fatal_fr(r, "kex_server_update_ext_info failed"); > + if (auth2_setup_methods_lists(authctxt) != 0) > + ssh_packet_disconnect(ssh, > + "no authentication methods enabled"); > + } else if (strcmp(user, authctxt->user) != 0 || > + strcmp(service, authctxt->service) != 0) { > + ssh_packet_disconnect(ssh, "Change of username or service " > + "not allowed: (%s,%s) -> (%s,%s)", > + authctxt->user, authctxt->service, user, service); > + } > + /* reset state */ > + auth2_challenge_stop(ssh); > + > +#ifdef GSSAPI > + /* XXX move to auth2_gssapi_stop() */ > + ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); > + ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); > +#endif > + > + auth2_authctxt_reset_info(authctxt); > + authctxt->postponed = 0; > + authctxt->server_caused_failure = 0; > + > + /* try to authenticate user */ > + m = authmethod_lookup(authctxt, method); > + if (m != NULL && authctxt->failures < options.max_authtries) { > + debug2("input_userauth_request: try method %s", method); > + authenticated = m->userauth(ssh, method); > + } > + if (!authctxt->authenticated && strcmp(method, "none") != 0) > + ensure_minimum_time_since(tstart, > + user_specific_delay(authctxt->user)); > + userauth_finish(ssh, authenticated, method, NULL); > *** 13039 LINES SKIPPED *** > Buildworld/buildkernel fails due to amutual error which might be : [...] make[5]: /usr/src/secure/libexec/sshd-auth/Makefile:41: Variable "MK_GSSAPI" is undefined in make[5] in directory "/usr/src/secure/libexec/sshd-auth" Regards, oh -- A FreeBSD user
pgpmg7gAUa7dB.pgp
Description: OpenPGP digital signature