Commit Graph

906 Commits

Author SHA1 Message Date
Damien Miller ef7c26cd2f
htole64() etc for systems without endian.h 2024-10-27 13:28:11 +11:00
Darren Tucker be27770e84
Remove references to systrace and pledge sandboxes.
ok djm@
2024-10-18 13:38:32 +11:00
Damien Miller 273581210c
declare defeat trying to detect C89 compilers
I can't find a reliable way to detect the features the ML-KEM code
requires in configure. Give up for now and use VLA support (that we
can detect) as a proxy for "old compiler" and turn off ML-KEM if
it isn't supported.
2024-09-09 17:30:38 +10:00
Damien Miller e8a0f19b56
fix previous; check for C99 compound literals
The previous commit was incorrect (or at least insufficient), the
ML-KEM code is actually using compound literals, so test for them.
2024-09-09 16:46:40 +10:00
Damien Miller 7c07bec144
test for compiler feature needed for ML-KEM
The ML-KEM implementation we uses need the compiler to support
C99-style named struct initialisers (e.g foo = {.bar = 1}). We
still support (barely) building OpenSSH with older compilers, so
add a configure test for this.
2024-09-09 16:06:21 +10:00
djm@openbsd.org 62fb2b51bb
upstream: pull post-quantum ML-KEM/x25519 key exchange out from
compile-time flag now than an IANA codepoint has been assigned for the
algorithm.

Add mlkem768x25519-sha256 in 2nd KexAlgorithms preference slot.

ok markus@

OpenBSD-Commit-ID: 9f50a0fae7d7ae8b27fcca11f8dc6f979207451a
2024-09-09 12:45:53 +10:00
djm@openbsd.org f68312eb59
upstream: Add experimental support for hybrid post-quantum key exchange
ML-KEM768 with ECDH/X25519 from the Internet-draft:
https://datatracker.ietf.org/doc/html/draft-kampanakis-curdle-ssh-pq-ke-03

This is based on previous patches from markus@ but adapted to use the
final FIPS203 standard ML-KEM using a formally-verified implementation
from libcrux.

Note this key exchange method is still a draft and thus subject to
change. It is therefore disabled by default; set MLKEM=yes to build it.
We're making it available now to make it easy for other SSH
implementations to test against it.

ok markus@ deraadt@

OpenBSD-Commit-ID: 02a8730a570b63fa8acd9913ec66353735dea42c
2024-09-02 22:32:44 +10:00
Darren Tucker 2a50a8f1fa
Add compat functions for EVP_Digest{Sign,Verify}.
This should make LibreSSL 3.1.x through 3.3.x work again.  Code from
tb@, ok djm@.  Restore the test configs covering those.
2024-08-17 11:25:36 +10:00
Damien Miller a7c6ea8eeb
sync TEST_MALLOC_OPTIONS for OpenBSD 2024-08-15 12:44:17 +10:00
Yuichiro Naito c276672fc0
Class-imposed login restrictions
If the following functions are available,
add an additional check if users are allowed to login imposed by login class.

* auth_hostok(3)
* auth_timeok(3)

These functions are implemented on FreeBSD.
2024-07-20 11:08:18 +10:00
Samuel Thibault ee6b9e6616
Fix detection of setres*id on GNU/Hurd
Like Linux, proper _SOURCE macros need to be set to get declarations of
various standard functions, notably setres*id. Now that Debian is using
-Werror=implicit-function-declaration this is really required. While at
it, define other _SOURCE macros like on GNU/Linux, since GNU/Hurd uses
the same glibc.
2024-07-03 19:22:50 +10:00
djm@openbsd.org 00eb95957d
upstream: disable the DSA signature algorithm by default; ok
markus@

(yes, I know this expands to "the Digitial Signature Algorithm
signature algorithm)

OpenBSD-Commit-ID: 961ef594e46dd2dcade8dd5721fa565cee79ffed
2024-06-17 18:48:29 +10:00
Darren Tucker 2eded551ba
Merge flags for OpenSSL 3.x versions.
OpenSSL has moved to 3.4 which we don't currently accept.  Based on
the OpenSSL versioning policy[0] it looks like all of the 3.x versions
should work with OpenSSH, so remove the distinction in configure and
accept all of them.

[0] https://openssl.org/policies/general/versioning-policy.html
2024-04-25 13:20:19 +10:00
Damien Miller 08f579231c
notify systemd on listen and reload
Standalone implementation that does not depend on libsystemd.
With assistance from Luca Boccassi, and feedback/testing from Colin
Watson. bz2641
2024-04-03 14:40:32 +11:00
Darren Tucker 281ea25a44
Check if OpenSSL implementation supports DSA.
If --enable/disable-dsa-keys is not specified, set based on what OpenSSL
supports.  If specified as enabled, but not supported by OpenSSL error
out.  ok djm@
2024-03-30 18:22:09 +11:00
Alkaid 8d0e46c1dd
Fix OpenSSL ED25519 support detection
Wrong function signature in configure.ac prevents openssh from enabling
the recently new support for ED25519 priv keys in PEM PKCS8 format.
2024-03-30 15:36:18 +11:00
Darren Tucker 9b3f0beb40
Prefer openssl binary from --with-ssl-dir directory.
Use openssl in the directory specified by --with-ssl-dir as long
as it's functional.  Reported by The Doctor.
2024-03-07 19:25:17 +11:00
Damien Miller 668d270a6c
add a --without-retpoline configure option
discussed with deraadt and dtucker a while ago
2024-03-06 10:33:20 +11:00
Damien Miller d86bf8a3f6
more descriptive configure test name 2024-02-22 12:06:10 +11:00
Darren Tucker efde85dda2
Improve error message for OpenSSL header check.
bz#3668, ok djm@
2024-02-19 17:29:31 +11:00
Darren Tucker be5ed8ebed
Add --disable-fd-passing option.
.. and enable for the minix3 test VM.  This will cause it to more reliably
skip tests that need FD passing and should fix the current test breakage.
2024-02-06 11:22:20 +11:00
djm@openbsd.org 4e838120a7
upstream: make DSA key support compile-time optional, defaulting to
on

ok markus@

OpenBSD-Commit-ID: 4f8e98fc1fd6de399d0921d5b31b3127a03f581d
2024-01-11 15:46:22 +11:00
Damien Miller 59d691b886
better detection of broken -fzero-call-used-regs
Use OSSH_CHECK_CFLAG_LINK() for detection of these flags and extend
test program to exercise varargs, which seems to catch more stuff.

ok dtucker@
2023-12-18 14:49:11 +11:00
Darren Tucker ff220d4010
Stop using -fzero-call-used-regs=all
... since it seems to be problematic with several different versions of
clang.  Only use -fzero-call-used-regs=used which is less
problematic, except with Apple's clang where we don't use it at all.
bz#3629, ok djm@
2023-11-21 14:04:34 +11:00
Darren Tucker 2a19e02f36
Allow for vendor prefix on clang version numbers.
Correctly detects the version of OpenBSD's native clang, as well as
Apple's.  Spotted tb@, ok djm@.
2023-11-21 14:02:18 +11:00
Darren Tucker 3e21d58a09
Add OpenSSL 3.3.0 as a known dev version. 2023-10-30 18:34:12 +11:00
Darren Tucker ff85becd5f
Have configure find PuTTY and Conch binaries.
This will let us remove some -portable specific changes from
test-exec.sh.
2023-10-20 20:35:46 +11:00
dtucker@openbsd.org c54a50359b
upstream: Allow overriding the locations of the Dropbear binaries
similar to what we do for the PuTTY ones.

OpenBSD-Regress-ID: 7de0e00518fb0c8fdc5f243b7f82f523c936049c
2023-10-20 20:28:20 +11:00
Darren Tucker 971e0cfcfd
Correct arg order for ED255519 AC_LINK_IFELSE test. 2023-10-12 16:23:05 +11:00
djm@openbsd.org 76e91e7238
upstream: add support for reading ED25519 private keys in PEM PKCS8
format; ok markus@ tb@

OpenBSD-Commit-ID: 01b85c91757e6b057e9b23b8a23f96415c3c7174
2023-10-12 09:59:44 +11:00
Darren Tucker 41232d2553
Use zero-call-used-regs=used with Apple compilers.
Apple's versions of clang have version numbers that do not match the
corresponding upstream clang versions.  Unfortunately, they do still
have the clang-15 zero-call-used-regs=all bug, so for now use the value
that doesn't result in segfaults.  We could allowlist future versions
that are known to work.  bz#3584 (and probably also our github CI
failures).
2023-09-10 15:45:38 +10:00
Darren Tucker cb4ed12ffc
Fix zlib version check for 1.3 and future version.
bz#3604.
2023-08-19 07:39:08 +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: 2efd71da49
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