Commit Graph

11762 Commits

Author SHA1 Message Date
Damien Miller
c46f6fed41 crank SSH_SK_VERSION_MAJOR in sk-dummy.so 2022-07-20 13:39:14 +10:00
djm@openbsd.org
f208e3b9ff upstream: ssh-keygen: fix touch prompt, pin retries;
part of GHPR329 from Pedro Martelletto

OpenBSD-Commit-ID: 75d1005bd2ef8f29fa834c90d2684e73556fffe8
2022-07-20 13:38:48 +10:00
djm@openbsd.org
8638a2ce7e upstream: sk-usbhid: preserve error code returned by key_lookup()
it conveys useful information, such as the supplied pin being wrong.

Part of GHPR329 from Pedro Martelletto

OpenBSD-Commit-ID: c0647eb9290f793add363d81378439b273756c1b
2022-07-20 13:38:47 +10:00
djm@openbsd.org
9ab929ca2d upstream: when enrolling a resident key on a security token, check
if a credential with matching application and user ID strings already exists.
if so, prompt the user for confirmation before overwriting the credential.

patch from Pedro Martelletto via GHPR329

NB. cranks SSH_SK_VERSION_MAJOR, so any third-party FIDO middleware
implementations will need to adjust

OpenBSD-Commit-ID: e45e9f1bf2b2f32d9850669e7a8dbd64acc5fca4
2022-07-20 13:38:47 +10:00
djm@openbsd.org
5bcfc788b3 upstream: pull passphrase reading and confirmation into a separate
function so it can be used for FIDO2 PINs; no functional change

OpenBSD-Commit-ID: bf34f76b8283cc1d3f54633e0d4f13613d87bb2f
2022-07-20 13:18:53 +10:00
Darren Tucker
eb679e2959 Move vmshutdown to first step.
If a previous run on a physical runner has failed to clean up, the next
run will fail because it'll try to check out the code to a broken
directory mount.  Make cleanup the first step.
2022-07-15 21:31:48 +10:00
Darren Tucker
46b91b70ff Rename bbone test target to ARM. 2022-07-15 20:25:27 +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
a061792a6e Remove unintended changes.
I inadvertently included a couple of local changes with the OpenSSL
3.0.4 change.  Revert, anything that should be there will be committed
separately.
2022-07-14 19:22:47 +10:00
Darren Tucker
527cb43fa1 Return ERANGE from getcwd() if buffer size is 1.
If getcwd() is supplied a buffer size of exactly 1 and a path of "/", it
could result in a nul byte being written out of array bounds.  POSIX says
it should return ERANGE if the path will not fit in the available buffer
(with terminating nul). 1 byte cannot fit any possible path with its nul,
so immediately return ERANGE in that case.

OpenSSH never uses getcwd() with this buffer size, and all current
(and even quite old) platforms that we are currently known to work
on have a native getcwd() so this code is not used on those anyway.
Reported by Qualys, ok djm@
2022-07-14 11:22:08 +10:00
Darren Tucker
36857fefd8 Split README.platform into its own line.
README.platform has general platform-specific information, having it
following text about FIDO2 on the same line could imply that it only
has information about FIDO2.
2022-07-14 10:02:35 +10:00
Darren Tucker
00a496c6c1 Clarify README.md text.
Clarify the text about the implications of building without OpenSSL, and
prefix the "configure --help" example command with a "./" so it's likely
to work as-is in more shells.  From bz#3461.
2022-07-14 09:56:01 +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
e75bbc1d88 Capture stderr output from configure. 2022-07-12 14:37:15 +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
fb2f3a61bf Move unset to before we set anything. 2022-07-12 12:54:24 +10:00
Darren Tucker
c483a5c0fb Test against openssl-3.0.5. 2022-07-06 11:52:54 +10:00
Darren Tucker
669a56bcfe Update sanitizer test targets:
- remove clang-sanitize-memory for now.  It takes so long that the test
   times out.
 - add gcc sanitize-address and sanitize-undefined test targets.
2022-07-05 18:35:53 +10:00
Darren Tucker
48cc68b691 Add GCC address sanitizer build/test. 2022-07-05 18:30:10 +10:00
Darren Tucker
55c60bdd39 Move sanitizer logs into regress for collection. 2022-07-05 18:30:10 +10:00
dtucker@openbsd.org
35ef2b3b6e upstream: Add TEST_REGRESS_CACHE_DIR.
If set, it is used to cache regress test names that have succeeded and
skip those on a re-run.

OpenBSD-Regress-ID: a7570dd29a58df59f2cca647c3c2ec989b49f247
2022-07-04 19:41:06 +10:00
Darren Tucker
7394ed80c4 Add clang sanitizer tests. 2022-07-03 22:53:44 +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
dtucker@openbsd.org
322964f8f2 upstream: Remove leftover line.
Remove extra line leftover from merge conflict. ok djm@

OpenBSD-Commit-ID: 460e2290875d7ae64971a7e669c244b1d1c0ae2e
2022-07-01 16:00:17 +10:00
djm@openbsd.org
7ec81daad0 upstream: use consistent field names (s/char/byte)
in format description

OpenBSD-Commit-ID: 3de33572733ee7fcfd7db33d37db23d2280254f0
2022-07-01 16:00:01 +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
djm@openbsd.org
4be7184ebe upstream: bump up loglevel from debug to info when unable to open
authorized keys/principals file for errno != ENOENT; bz2042 ok dtucker

OpenBSD-Commit-ID: e79aa550d91ade6a80f081bda689da24c086d66b
2022-07-01 13:54:53 +10:00
dtucker@openbsd.org
6c31ba10e9 upstream: Don't leak the strings allocated by order_hostkeyalgs()
and list_hostkey_types() that are passed to compat_pkalg_proposal(). Part of
github PR#324 from ZoltanFridrich, ok djm@

This is a roll-forward of the previous rollback now that the required
changes in compat.c have been done.

OpenBSD-Commit-ID: c7cd93730b3b9f53cdad3ae32462922834ef73eb
2022-07-01 13:41:16 +10:00
dtucker@openbsd.org
486c4dc3b8 upstream: Always return allocated strings from the kex filtering so
that we can free them later.  Fix one leak in compat_kex_proposal.  Based on
github PR#324 from ZoltanFridrich with some simplications by me. ok djm@

OpenBSD-Commit-ID: 9171616da3307612d0ede086fd511142f91246e4
2022-07-01 13:41:16 +10:00
djm@openbsd.org
96faa0de6c upstream: ignore SIGPIPE earlier in main(), specifically before
muxclient() which performs operations that could cause one; Reported by Noam
Lewis via bz3454, ok dtucker@

OpenBSD-Commit-ID: 63d8e13276869eebac6d7a05d5a96307f9026e47
2022-07-01 10:37:46 +10:00
jmc@openbsd.org
33efac790f upstream: reflect the update to -D arg name in usage();
OpenBSD-Commit-ID: abdcde4f92b1ef094ae44210ee99d3b0155aad9c
2022-07-01 10:37:46 +10:00
Darren Tucker
c71a1442d0 Update OpenSSL tests to the most recent releases. 2022-06-29 18:28:47 +10:00
djm@openbsd.org
2a822f2930 upstream: allow arguments to sftp -D option, e.g. sftp -D
"/usr/libexec/sftp-server -el debug3"

ok markus@

OpenBSD-Commit-ID: 5a002b9f3a7aef2731fc0ffa9c921cf15f38ecce
2022-06-28 07:43:15 +10:00
dtucker@openbsd.org
2369a28101 upstream: Roll back previous KEX changes as they aren't safe until
compat_pkalg_proposal and friends always allocate their returned strings.
Reported by Qualys.

OpenBSD-Commit-ID: 1c7a88a0d5033f42f88ab9bec58ef1cf72c81ad0
2022-06-28 07:43:15 +10:00
dtucker@openbsd.org
646686136c upstream: Don't leak the strings allocated by order_hostkeyalgs()
and list_hostkey_types() that are passed to compat_pkalg_proposal(). Part of
github PR#324 from ZoltanFridrich, ok djm@

OpenBSD-Commit-ID: b2f6e5f60f2bba293b831654328a8a0035ef4a1b
2022-06-28 07:43:15 +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
djm@openbsd.org
455cee8d6c upstream: make it clear that RekeyLimit applies to both transmitted
and received data. GHPR#328 from Jan Pazdziora

OpenBSD-Commit-ID: d180a905fec9ff418a75c07bb96ea41c9308c3f9
2022-06-24 14:28:29 +10:00
tobhe@openbsd.org
17904f0580 upstream: Make sure not to fclose() the same fd twice in case of an
error.

ok dtucker@

OpenBSD-Commit-ID: e384c4e05d5521e7866b3d53ca59acd2a86eef99
2022-06-24 14:28:29 +10:00
dtucker@openbsd.org
f29d6cf98c upstream: Don't attempt to fprintf a null identity comment. From
Martin Vahlensieck via tech@.

OpenBSD-Commit-ID: 4c54d20a8e8e4e9912c38a7b4ef5bfc5ca2e05c2
2022-06-24 14:28:29 +10:00
dtucker@openbsd.org
ad1762173b upstream: Log an error if pipe() fails while accepting a
connection.  bz#3447, from vincent-openssh at vinc17 net, ok djm@

OpenBSD-Commit-ID: 9d59f19872b94900a5c79da2d57850241ac5df94
2022-06-24 14:28:29 +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
Damien Miller
7d25b37fb2 fix possible NULL deref when built without FIDO
Analysis/fix from kircher in bz3443; ok dtucker@
2022-06-24 13:46:39 +10:00
djm@openbsd.org
f5ba85dadd upstream: make sure that UseDNS hostname lookup happens in the monitor
and not in the pledge(2)'d unprivileged process; fixes regression caused by
recent refactoring spotted by henning@

OpenBSD-Commit-ID: a089870b95101cd8881a2dff65b2f1627d13e88d
2022-06-16 02:12:11 +10:00
djm@openbsd.org
acb2059feb upstream: move auth_openprincipals() and auth_openkeyfile() over to
auth2-pubkeyfile.c too; they make more sense there.

OpenBSD-Commit-ID: 9970d99f900e1117fdaab13e9e910a621b7c60ee
2022-06-03 14:49:18 +10:00
djm@openbsd.org
3d9b0845f3 upstream: test setenv in both client and server, test first-match-wins
too

OpenBSD-Regress-ID: 4c8804f9db38a02db480b9923317457b377fe34b
2022-06-03 14:34:12 +10:00