Commit Graph

875 Commits

Author SHA1 Message Date
Darren Tucker e99a02ec18
Fix zlib version check for 1.3 and future version.
bz#3604.
2023-08-19 07:41:24 +10:00
Damien Miller b7e27cfd7f
put back SSLeay_version compat in configure test
Needed to detect old versions and give good "your version is bad"
messages at configure time; spotted by dtucker@
2023-03-24 15:26:26 +11:00
Damien Miller 7280401bdd
remove support for old libcrypto
OpenSSH now requires LibreSSL 3.1.0 or greater or
OpenSSL 1.1.1 or greater

with/ok dtucker@
2023-03-24 13:56:25 +11:00
Damien Miller 6b508c4e03
fix libfido2 detection without pkg-config
Place libfido2 before additional libraries (that it may depend upon)
and not after. bz3530 from James Zhang; ok dtucker@
2023-02-01 12:14:22 +11:00
Darren Tucker 26cab41c05
Use autoconf to find openssl binary.
It's possible to install an OpenSSL in a path not in the system's
default library search path.  OpenSSH can still use this (eg if you
specify an rpath) but the openssl binary there may not work.  If one is
available on the system path just use that.
2023-01-07 14:30:43 +11:00
Darren Tucker 5532e010a0
Check openssl_bin path is executable before using. 2023-01-07 10:34:18 +11:00
Darren Tucker 5d7b16cff4
Set OPENSSL_BIN from OpenSSL directory. 2023-01-06 23:19:07 +11:00
Darren Tucker d63f549497
Fix typo in comment. Spotted by tim@ 2022-12-06 12:22:36 +11:00
Darren Tucker 62cc33e6ee
Use -fzero-call-used-regs=used on clang 15.
clang 15 seems to have a problem with -fzero-call-used-reg=all which
causes spurious "incorrect signature" failures with ED25519.  On those
versions, use -fzero-call-used-regs=used instead.  (We may add exceptions
later if specific versions prove to be OK).  Also move the GCC version
check to match.

Initial investigation by Daniel Pouzzner (douzzer at mega nu), workaround
suggested by Bill Wendling (morbo at google com).  bz#3475, ok djm@
2022-11-30 11:45:07 +11:00
Darren Tucker 6b9bbbfe8b
If we haven't found it yet, recheck for sys/stat.h.
On some very old platforms, sys/stat.h needs sys/types.h, however
autoconf 2.71's AC_CHECK_INCLUDES_DEFAULT checks for them in the
opposite order, which in combination with modern autoconf's
"present but cannot be compiled" behaviour causes it to not be
detected.
2022-11-23 13:24:50 +11:00
Darren Tucker 32fddb982f
Fix setres*id checks to work with clang-16.
glibc has the prototypes for setresuid and setresgid behind _GNU_SOURCE,
and clang 16 will error out on implicit function definitions, so add
_GNU_SOURCE and the required headers to the configure checks.  From
sam at @gentoo.org via bz#3497.
2022-11-07 10:39:01 +11:00
Sam James 12af712d11
configure.ac: Fix -Wstrict-prototypes
Clang 16 now warns on this and it'll be removed in C23, so let's
just be future proof. It also reduces noise when doing general
Clang 16 porting work (which is a big job as it is).  github PR#355.

Signed-off-by: Sam James <sam@gentoo.org>
2022-11-06 18:51:52 +11:00
Sam James 40b0a5eb6e
configure.ac: Add <pty.h> include for openpty
Another Clang 16ish fix (which makes -Wimplicit-function-declaration
an error by default).  github PR#355.

See: 2efd71da49b9cfeab7987058cf5919e473ff466b
See: be19763532
2022-11-06 18:51:52 +11:00
Darren Tucker 5ebe18cab6
Check for sockaddr_in.sin_len.
If found, set SOCK_HAS_LEN which is used in addr.c.  Should fix keyscan
tests on platforms with this (eg old NetBSD).
2022-11-02 10:51:48 +11:00
Darren Tucker f6d3ed9a8a
OpenSSL dev branch is 302 not 320.
While there, also accept 301 which it shat it was previously.
2022-10-31 05:13:02 +11:00
Darren Tucker 614252b05d
OpenSSL dev branch now identifies as 3.2.0. 2022-10-18 06:29:16 +11:00
Harmen Stoppels 5eb796a369
Fix snprintf configure test for clang 15
Clang 15 -Wimplicit-int defaults to an error in C99 mode and above.
A handful of tests have "main(..." and not "int main(..." which caused
the tests to produce incorrect results.
2022-10-14 07:37:16 +11:00
Darren Tucker 87b0d9c1b7 Add a timegm implementation from Heimdal via Samba.
Fixes build on (at least Solaris 10).
2022-08-11 22:51:10 +10:00
Corinna Vinschen 78774c08cc compat code for fido_dev_is_winhello()
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2022-08-05 14:39:05 +10:00
Darren Tucker 3d3a932a01 Factor out getrnd() and rename to getentropy().
Factor out the arc4random seeding into its own file and change the
interface to match getentropy.  Use native getentropy if available.
This will make it easier to resync OpenBSD changes to arc4random.
Prompted by bz#3467, ok djm@.
2022-08-05 13:12:27 +10:00
Darren Tucker 9385d277b7 Include CHANNEL and FIDO2 libs in configure output 2022-08-04 22:02:04 +10:00
Darren Tucker 722a56439a Move stale-configure check as early as possible.
We added a check in Makefile to catch the case where configure needs to
be rebuilt, however this did not happen until a build was attempted in
which case all of the work done by configure was wasted.  Move this check
 to the start of configure to catch it as early as possible.  ok djm@
2022-07-27 18:31:14 +10:00
Darren Tucker 099d6b5628 Move libcrypto into CHANNELLIBS.
This will result in sftp, sftp-server and scp no longer being linked
against libcrypto.  ok djm@
2022-07-27 16:22:39 +10:00
Darren Tucker d73f77b8cb Group libcrypto and PRNGD checks together.
They're related more than the libcrypt or libiaf checks which are
currently between them.  ok djm@
2022-07-27 16:22:12 +10:00
Darren Tucker f117e372b3 Do not link scp, sftp and sftp-server w/ zlib.
Some of our binaries (eg sftp, sftp-server, scp) do not interact with
the channels code and thus do use libraries such as zlib and libcrypto
although they are linked with them.  This adds a CHANNELLIBS and starts
by moving zlib into it, which means the aformentioned binaries are no
longer linked against zlib.  ok djm@
2022-07-27 16:22:03 +10:00
Darren Tucker 800c2483e6 Remove workarounds for OpenSSL missing AES-CTR.
We have some compatibility hacks that were added to support OpenSSL
versions that do not support AES CTR mode.  Since that time, however,
the minimum OpenSSL version that we support has moved to 1.0.1 which
*does* have CTR, so this is no longer needed.  ok djm@
2022-07-25 21:49:04 +10:00
Darren Tucker b7c56b65c1 Remove workarounds for OpenSSL missing AES-GCM.
We have some compatibility hacks that were added to support OpenSSL
versions that do not support AES GCM mode.  Since that time, however,
the minimum OpenSSL version that we support has moved to 1.0.1 which
*does* have GCM, so this is no longer needed.  ok djm@
2022-07-25 21:43:00 +10:00
Darren Tucker 751d22cdef Add AUDIT_ARCH_PPC to supported seccomp arches.
Patch from dries.deschout at dodeco.eu.
2022-07-15 13:37:29 +10:00
Darren Tucker f40b52f21f Remove special casing of crypt().
Configure goes to some lengths to pick crypt() from either libcrypt
or OpenSSL's libcrypto because they can more or less featureful (eg
supporting md5-style passwords).

OpenSSL removed its crypt() interface in 2002:
https://github.com/openssl/openssl/commit/69deec58 so these hijinks
should no longer be necessary.  This also only links sshd with libcrypt
which is the only thing that needs it.  ok djm@
2022-07-13 18:41:38 +10:00
Darren Tucker 76f4e48631 Only refuse to use OpenSSL 3.0.4 on x86_64.
The potential RCE only impacts x86_64, so only refuse to use it if we're
targetting a potentially impacted architecture.  ok djm@
2022-07-13 13:17:47 +10:00
Darren Tucker d9eaea4bea Refuse to use OpenSSL 3.0.4 due to potential RCE.
OpenSSL has a potential RCE in its RSA implementation (CVE-2022-2274)
so refuse to use that specific version.
2022-07-12 12:54:49 +10:00
Darren Tucker bfce0e66b6 Skip all rlimit tests when sandboxing disabled.
The rlimit tests can hang when being run with some compiler sanitizers
so skip all of them if sandbox=no.
2022-07-03 18:14:09 +10:00
Darren Tucker 6208d61152 Move checks for pollfd.fd and nfds_t.
Move the checks for struct pollfd.fd and nfds_t to before the sandboxing
checks.  This groups all the sandbox checks together so we can skip them
all when sandboxing is disabled.
2022-07-03 17:54:49 +10:00
Darren Tucker 32e82a392d Skip select+rlimit check if sandboxing is disabled
It's not needed in that case, and the test can fail when being built
with some compiler memory sanitizer flags.  bz#3441
2022-07-01 13:57:43 +10:00
Darren Tucker 193c6d8d90 Zero out LIBFIDO2 when SK support not usable.
Prevents us from trying to link them into ssh-sk-helper and failing to
build.
2022-06-25 12:16:15 +10:00
Darren Tucker 40f5d849d2 Disable SK support if FIDO libs not found. 2022-06-25 11:47:28 +10:00
Damien Miller 5fd922ade1 fix broken case statement in previous 2022-06-24 14:43:54 +10:00
Damien Miller f51423bdaf request 1.1x API compatibility for OpenSSL >=3.x
idea/patch from Pedro Martelletto via GHPR#322; ok dtucker@
2022-06-24 14:40:42 +10:00
Damien Miller 9c59e7486c automatically enable built-in FIDO support
If libfido2 is found and usable, then enable the built-in
security key support unless --without-security-key-builtin
was requested.

ok dtucker@
2022-06-24 14:20:43 +10:00
Tim Rice 2487163630 configure.ac: Add missing AC_DEFINE for caph_cache_tzdata test causing
HAVE_CAPH_CACHE_TZDATA to be missing from config.h.in.
Spotted by Bryan Drewery
2022-05-24 10:21:25 -07:00
Darren Tucker 4cc05de568 Cache timezone data in capsicum sandbox.
From emaste at freebsd.org, originally part of FreeBSD commit r339216
/ fc3c19a9 with autoconf bits added by me.
2022-04-23 21:14:01 +10:00
Darren Tucker 02488c1b54 Use bash or ksh if available for SH in Makefile. 2022-04-01 16:29:14 +11:00
Darren Tucker 5ae31a0fdd Provide killpg implementation.
Based on github PR#301 for Tandem NonStop.
2022-03-09 09:41:56 +11:00
Darren Tucker c41c84b439 Check for missing ftruncate prototype.
From github PR#301 in conjunction with rsbeckerca.
2022-03-09 09:29:30 +11:00
Darren Tucker 8cf5275452 Default to not using sandbox when cross compiling.
On most systems poll(2) does not work when the number of FDs is reduced
with setrlimit, so assume it doesn't when cross compiling and we can't
run the test.  bz#3398.
2022-03-08 20:04:06 +11:00
Darren Tucker bc16667b4a Extend select+rlimit sanbox test to include poll.
POSIX specifies that poll() shall fail if "nfds argument is greater
than {OPEN_MAX}".  The setrlimit sandbox sets this to effectively zero
so this causes poll() to fail in the preauth privsep process.

This is likely the underlying cause for the previously observed similar
behaviour of select() on plaforms where it is implement in userspace on
top of poll().
2022-02-22 15:39:37 +11:00
Darren Tucker a4b325a3fc Include sys/param.h if present.
Needed for howmany() on MUSL systems such as Alpine.
2022-02-22 12:27:07 +11:00
Damien Miller f7fc6a43f1 minix needs BROKEN_POLL too; chokes on /dev/null 2022-02-17 22:54:19 +11:00
Darren Tucker cd00b48cf1 Simplify handling of --with-ssl-dir.
ok djm@
2022-02-11 20:09:32 +11:00
Damien Miller 56192518e3 compat code for fido_assert_set_clientdata() 2022-02-07 12:53:47 +11:00