Commit Graph

523 Commits

Author SHA1 Message Date
dtucker@openbsd.org a6f4ac8a2b
upstream: Rework logging for the regression tests.
Previously we would log to ssh.log and sshd.log, but that is insufficient
for tests that have more than one concurent ssh/sshd.

Instead, we'll log to separate datestamped files in a $OBJ/log/ and
leave a symlink at the previous location pointing at the most recent
instance with an entry in regress.log showing which files were created
at each point.  This should be sufficient to reconstruct what happened
even for tests that use multiple instances of each program.  If the test
fails, tar up all of the logs for later analysis.

This will let us also capture the output from some of the other tools
which was previously sent to /dev/null although most of those will be
in future commits.

OpenBSD-Regress-ID: f802aa9e7fa51d1a01225c05fb0412d015c33e24
2023-03-01 22:02:47 +11:00
Damien Miller 9fe207565b
adapt compat_kex_proposal() test to portable 2023-02-02 23:17:49 +11:00
djm@openbsd.org 9fbbfeca1c
upstream: update OpenSSH's Ed25519 code to the last version of SUPERCOP
(20221122) and change the import approach to the same one we use for
Streamlined NTRUPrime: use a shell script to extract the bits we need from
SUPERCOP, make some minor adjustments and squish them all into a single file.

ok tb@ tobhe@

OpenBSD-Commit-ID: 1bc0fd624cb6af440905b8ba74ac7c03311b8e3b
2023-01-16 10:57:41 +11:00
Darren Tucker 5d7b16cff4
Set OPENSSL_BIN from OpenSSL directory. 2023-01-06 23:19:07 +11:00
djm@openbsd.org 161a5378a3
upstream: unit tests for misc.c:ptimeout_* API
OpenBSD-Regress-ID: 01f8fb12d08e5aaadd4bd4e71f456b6588be9a94
2023-01-06 21:37:40 +11:00
djm@openbsd.org 9d95252911
upstream: use users-groups-by-id@openssh.com sftp-server extension
(when available) to fill in user/group names for directory listings.
Implement a client-side cache of see uid/gid=>user/group names. ok markus@

OpenBSD-Commit-ID: f239aeeadfa925a37ceee36ee8b256b8ccf4466e
2022-09-19 20:51:14 +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 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
djm@openbsd.org c83d8c4d6f upstream: split the low-level file handling functions out from
auth2-pubkey.c

Put them in a new auth2-pubkeyfile.c to make it easier to refer to them
(e.g. in unit/fuzz tests) without having to refer to everything else
pubkey auth brings in.

ok dtucker@

OpenBSD-Commit-ID: 3fdca2c61ad97dc1b8d4a7346816f83dc4ce2217
2022-05-27 16:38:03 +10:00
Darren Tucker 34c7018c31 Set Makefile SHELL as determined by configure.
This should improve compatibility for users with non-POSIX shells.  If
using Makefile.in directly (eg make -f Makefile.in distprep) then SHELL
will need to be specified on the command line (along with MANFMT in that
particular case).  ok djm@
2022-04-01 14:56:54 +11:00
Darren Tucker 54a86f4f6e Use PICFLAG instead of hard coding -fPIC. 2022-02-25 13:23:04 +11:00
dtucker@openbsd.org a29af853cf upstream: Add unit tests for hpdelim.
OpenBSD-Regress-ID: be97b85c19895e6a1ce13c639765a3b48fd95018
2022-02-10 15:17:28 +11:00
Damien Miller a5ab488234 remove built-in support for md5crypt()
Users of MD5-hashed password should arrange for ./configure to link
against libxcrypt or similar. Though it would be better to avoid use
of MD5 password hashing entirely, it's arguably worse than DEScrypt.

feedback and ok dtucker@
2021-10-28 16:16:13 +11:00
Damien Miller 3b353ae58a clean regress/misc/sk-dummy in cleandir target 2021-10-06 15:07:01 +11:00
Darren Tucker c9172193ea Remove TEST_SSH_ECC.
Convert the only remaining user of it to runtime detection using ssh -Q.
2021-09-29 18:33:38 +10:00
Darren Tucker c4ac7f98e2 Expand TEST_SHELL consistently with other vars. 2021-09-29 17:40:50 +10:00
Darren Tucker cfe5f7b0eb Replace `pwd` with make variable in regress cmd. 2021-09-29 17:26:50 +10:00
Darren Tucker 899be59da5 Get BUILDDIR from autoconf.
Use this to replace `pwd`s in regress test command line.
2021-09-29 17:14:33 +10:00
Darren Tucker 7d878679a4 Remove trailing backslash on regress-unit-binaries 2021-08-17 15:12:04 +10:00
djm@openbsd.org 197e29f1cc upstream: support for using the SFTP protocol for file transfers in
scp, via a new "-M sftp" option. Marked as experimental for now.

Some corner-cases exist, in particular there is no attempt to
provide bug-compatibility with scp's weird "double shell" quoting
rules.

Mostly by Jakub Jelen in GHPR#194 with some tweaks by me. ok markus@
Thanks jmc@ for improving the scp.1 bits.

OpenBSD-Commit-ID: 6ce4c9157ff17b650ace571c9f7793d92874051c
2021-08-03 11:03:09 +10:00
Darren Tucker 7ebfe4e439 Put second -lssh in link line for sftp-server.
When building --without-openssl the recent port-prngd.c change adds
a dependency on atomicio, but since nothing else in sftp-server uses
it, the linker may not find it.  Add a second -lssh similar to other
binaries.
2021-06-18 20:41:45 +10:00
djm@openbsd.org 39f6cd2078 upstream: unit test for misc.c:strdelim() that mostly servces to
highlight its inconsistencies

OpenBSD-Regress-ID: 8d2bf970fcc01ccc6e36a5065f89b9c7fa934195
2021-06-01 14:38:41 +10:00
Darren Tucker 1f189181f3 Pass OBJ to unit test make invocation.
At least the Valgrind unit tests uses $OBJ.
2021-04-08 15:17:19 +10:00
Damien Miller f3ca8af87a enable authopt and misc unit tests
Neither were wired into the build, both required some build
adaptations for -portable
2021-04-03 18:21:08 +11:00
Darren Tucker 0c054538fc Point TEST_SSH_MODULI_FILE at our own moduli.
This will allow the test to run without requiring a moduli file
installed at the configured default path.
2021-03-13 13:51:26 +11:00
djm@openbsd.org 1fe4d70df9 upstream: remove this KEX fuzzer; it's awkward to use and doesn't play
nice with popular fuzzing drivers like libfuzzer. AFAIK nobody has used it
but me.

OpenBSD-Regress-ID: cad919522b3ce90c147c95abaf81b0492ac296c9
2021-02-26 15:23:42 +11:00
dtucker@openbsd.org 3a92312953 upstream: Add PerSourceMaxStartups and PerSourceNetBlockSize
options which provide more fine grained MaxStartups limits.  Man page help
jmc@, feedback & ok djm@

OpenBSD-Commit-ID: e2f68664e3d02c0895b35aa751c48a2af622047b
2021-01-11 15:04:12 +11:00
dtucker@openbsd.org d9a2bc7169 upstream: Move address handling functions out into their own file
in order to reuse them for per-source maxstartups limiting.  Supplement with
some additional functions from djm's flowtools that we'll also need.  ok djm@
(as part of a larger diff).

OpenBSD-Commit-ID: e3e7d9ccc6c9b82e25cfef0ec83598e8e2327cbf
2021-01-11 15:04:12 +11:00
djm@openbsd.org 2c71cec020 upstream: Update/replace the experimental post-quantim hybrid key
exchange method based on Streamlined NTRU Prime (coupled with X25519).

The previous sntrup4591761x25519-sha512@tinyssh.org method is
replaced with sntrup761x25519-sha512@openssh.com. Per the authors,
sntrup4591761 was replaced almost two years ago by sntrup761.

The sntrup761 implementaion, like sntrup4591761 before it, is public
domain code extracted from the SUPERCOP cryptography benchmark
suite (https://bench.cr.yp.to/supercop.html).

Thanks for Daniel J Bernstein for guidance on algorithm selection.
Patch from Tobias Heider; feedback & ok markus@ and myself

(note this both the updated method and the one that it replaced are
disabled by default)

OpenBSD-Commit-ID: 2bf582b772d81ee24e911bb6f4b2aecfd39338ae
2020-12-29 12:38:53 +11:00
Sebastian Andrzej Siewior a2f3ae386b Move the local m4 macros
The `aclocal' step is skipped during `autoreconf' because aclocal.m4 is
present.
Move the current aclocal.m4 which contains local macros into the m4/
folder. With this change the aclocal.m4 will be re-created during
changes to the m4/ macro.
This is needed so the `aclocal' can fetch m4 macros from the system if
they are references in the configure script. This is a prerequisite to
use PKG_CHECK_MODULES.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2020-09-11 13:18:42 +10:00
Darren Tucker eaf8672b1b Remove check for 'ent' command.
It was added in 8d1fd57a9 for measuring entropy of ssh_prng_cmds which
has long since been removed and there are no other references to it.
2020-08-21 00:07:48 +10:00
djm@openbsd.org 976c4f8628 upstream: avoid spurious error message when ssh-keygen creates files
outside ~/.ssh; with dtucker@

OpenBSD-Commit-ID: ac0c662d44607e00ec78c266ee60752beb1c7e08
2020-06-26 15:44:47 +10:00
Darren Tucker 80610e97a7 Hook sshsig tests up to Portable Makefiles. 2020-06-19 17:15:27 +10:00
Darren Tucker 08ce6b2210 Skip building sk-dummy library if no SK support. 2020-05-13 13:56:45 +10:00
Damien Miller 102d106bc2 explicitly manage .depend and .depend.bak
Bring back removal of .depend to give the file a known state before
running makedepend, but manually move aside the current .depend file
and restore it as .depend.bak afterwards so the stale .depend check
works as expected.
2020-05-13 12:08:34 +10:00
Damien Miller 7c0bbed967 revert removal of .depend before makedepend
Commit 83657eac4 started removing .depend before running makedepend
to reset the contents of .depend to a known state. Unfortunately
this broke the depend-check step as now .depend.bak would only ever
be created as an empty file.

ok dtucker
2020-05-13 12:01:10 +10:00
Darren Tucker 83657eac42 Remove use of tail for 'make depend'.
Not every tail supports +N and we can do with out it so just remove it.
Prompted by mforney at mforney.org.
2020-05-02 18:29:40 +10:00
Darren Tucker cecde6a416 Put the values from env vars back.
This merges the values from the recently removed environment into make's
command line arguments since we actually need those.
2020-04-22 12:09:40 +10:00
Darren Tucker 300c4322b9 Pass configure's egrep through to test-exec.sh.
Use it to create a wrapper function to call it from tests.  Fixes the
keygen-comment test on platforms with impoverished default egrep (eg
Solaris).
2020-04-22 11:35:49 +10:00
Darren Tucker c8d9796cfe Remove unneeded env vars from t-exec invocation. 2020-04-22 11:35:49 +10:00
Damien Miller abe2b245b3 prefer libcrypto chacha20-poly1305 where possible 2020-04-03 17:26:29 +11:00
djm@openbsd.org 99aa803555 upstream: factor out reading/writing sshbufs to dedicated
functions; feedback and ok markus@

OpenBSD-Commit-ID: dc09e5f1950b7acc91b8fdf8015347782d2ecd3d
2020-01-26 10:18:42 +11:00
Damien Miller 633778d567 only link ssh-sk-helper against libfido2 2019-12-14 08:40:58 +11:00
Damien Miller 7b47b40b17 adapt Makefile to ssh-sk-client everywhere 2019-12-14 08:40:58 +11:00
Darren Tucker 5e3abff39e Sort .depend when rebuilding.
This makes diffs more stable between makedepend implementations.
2019-12-11 13:12:59 +11:00
Damien Miller 443848155f compile sk-dummy.so with no-PIE version of LDFLAGS
This lets it pick up the -L path to libcrypto for example.
2019-11-29 15:10:21 +11:00
Damien Miller b218055e59 (yet) another x-platform fix for sk-dummy.so
Check for -fPIC support from compiler

Compile libopenbsd-compat -fPIC

Don't mix -fPIE and -fPIC when compiling
2019-11-29 12:32:23 +11:00
Damien Miller ef3853bb94 another attempt at sk-dummy.so working x-platform
include a fatal() implementation to satisfy libopenbsd-compat

clean up .lo and .so files

.gitignore .lo and .so files
2019-11-29 11:52:23 +11:00