]> git.ipfire.org Git - thirdparty/openssh-portable.git/log
thirdparty/openssh-portable.git
3 years agoupstream: use status error message to communicate ~user expansion
djm@openbsd.org [Sat, 8 Jan 2022 07:37:32 +0000 (07:37 +0000)] 
upstream: use status error message to communicate ~user expansion

failures; provides better experience for scp in sftp mode, where ~user paths
are more likely to be used; spotted jsg, feedback jsg & deraadt ok jsg &
markus

OpenBSD-Commit-ID: fc610ce00ca0cdc2ecdabbd49ce7cb82033f905f

3 years agoupstream: fix some corner-case bugs in scp sftp-mode handling of
djm@openbsd.org [Sat, 8 Jan 2022 07:36:11 +0000 (07:36 +0000)] 
upstream: fix some corner-case bugs in scp sftp-mode handling of

~-prefixed paths; spotted by jsg; feedback jsg & deraadt, ok jsg & markus

OpenBSD-Commit-ID: d1697dbaaa9f0f5649d69be897eab25c7d37c222

3 years agoupstream: more idiomatic error messages; spotted by jsg & deraadt
djm@openbsd.org [Sat, 8 Jan 2022 07:34:57 +0000 (07:34 +0000)] 
upstream: more idiomatic error messages; spotted by jsg & deraadt

ok jsg & markus

OpenBSD-Commit-ID: 43618c692f3951747b4151c477c7df22afe2bcc8

3 years agoupstream: add a variant of send_status() that allows overriding the
djm@openbsd.org [Sat, 8 Jan 2022 07:33:54 +0000 (07:33 +0000)] 
upstream: add a variant of send_status() that allows overriding the

default, generic error message. feedback/ok markus & jsg

OpenBSD-Commit-ID: 81f251e975d759994131b717ee7c0b439659c40f

3 years agoupstream: refactor tilde_expand_filename() and make it handle ~user
djm@openbsd.org [Sat, 8 Jan 2022 07:32:45 +0000 (07:32 +0000)] 
upstream: refactor tilde_expand_filename() and make it handle ~user

paths with no trailing slash; feedback/ok markus and jsg

OpenBSD-Commit-ID: a2ab365598a902f0f14ba6a4f8fb2d07a9b5d51d

3 years agoupstream: Don't explicitly set HostbasedAuthentication in
dtucker@openbsd.org [Thu, 6 Jan 2022 22:14:25 +0000 (22:14 +0000)] 
upstream: Don't explicitly set HostbasedAuthentication in

sshd_config. It defaults to "no", and not explicitly setting it allows us to
enable it for the (optional) hostbased test.

OpenBSD-Regress-ID: aa8e3548eb5793721641d26e56c29f363b767c0c

3 years agoupstream: Add test for hostbased auth. It requires some external
dtucker@openbsd.org [Thu, 6 Jan 2022 21:46:56 +0000 (21:46 +0000)] 
upstream: Add test for hostbased auth. It requires some external

setup (see comments at the top) and thus is disabled unless
TEST_SSH_HOSTBASED_AUTH and SUDO are set.

OpenBSD-Regress-ID: 3ec8ba3750c5b595fc63e7845d13483065a4827a

3 years agodepend
Damien Miller [Thu, 6 Jan 2022 22:24:26 +0000 (09:24 +1100)] 
depend

3 years agoupstream: allow hostbased auth to select RSA keys when only
djm@openbsd.org [Thu, 6 Jan 2022 22:06:51 +0000 (22:06 +0000)] 
upstream: allow hostbased auth to select RSA keys when only

RSA/SHA2 are configured (this is the default case); ok markus@

OpenBSD-Commit-ID: 411c18c7bde40c60cc6dfb7017968577b4d4a827

3 years agoupstream: add a helper function to match a key type to a list of
djm@openbsd.org [Thu, 6 Jan 2022 22:05:42 +0000 (22:05 +0000)] 
upstream: add a helper function to match a key type to a list of

signature algorithms. RSA keys can make signatures with multiple algorithms,
so some special handling is required. ok markus@

OpenBSD-Commit-ID: 03b41b2bda06fa4cd9c84cef6095033b9e49b6ff

3 years agoupstream: log some details on hostkeys that ssh loads for
djm@openbsd.org [Thu, 6 Jan 2022 22:04:20 +0000 (22:04 +0000)] 
upstream: log some details on hostkeys that ssh loads for

hostbased authn ok markus@

OpenBSD-Commit-ID: da17061fa1f0e58cb31b88478a40643e18233e38

3 years agoupstream: log signature algorithm during verification by monitor;
djm@openbsd.org [Thu, 6 Jan 2022 22:03:59 +0000 (22:03 +0000)] 
upstream: log signature algorithm during verification by monitor;

ok markus

OpenBSD-Commit-ID: 02b92bb42c4d4bf05a051702a56eb915151d9ecc

3 years agoupstream: piece of UpdateHostkeys client strictification: when
djm@openbsd.org [Thu, 6 Jan 2022 22:02:52 +0000 (22:02 +0000)] 
upstream: piece of UpdateHostkeys client strictification: when

updating known_hosts with new keys, ignore NULL keys (forgot to include in
prior commit)

OpenBSD-Commit-ID: 49d2eda6379490e1ceec40c3b670b973f63dea08

3 years agoupstream: include rejected signature algorithm in error message
djm@openbsd.org [Thu, 6 Jan 2022 22:01:14 +0000 (22:01 +0000)] 
upstream: include rejected signature algorithm in error message

and not the (useless) key type; ok markus

OpenBSD-Commit-ID: 4180b5ec7ab347b43f84e00b1972515296dab023

3 years agoupstream: make ssh-keysign use the requested signature algorithm
djm@openbsd.org [Thu, 6 Jan 2022 22:00:18 +0000 (22:00 +0000)] 
upstream: make ssh-keysign use the requested signature algorithm

and not the default for the keytype. Part of unbreaking hostbased auth for
RSA/SHA2 keys. ok markus@

OpenBSD-Commit-ID: b5639a14462948970da3a8020dc06f9a80ecccdc

3 years agoupstream: stricter UpdateHostkey signature verification logic on
djm@openbsd.org [Thu, 6 Jan 2022 21:57:28 +0000 (21:57 +0000)] 
upstream: stricter UpdateHostkey signature verification logic on

the client- side. Require RSA/SHA2 signatures for RSA hostkeys except when
RSA/SHA1 was explicitly negotiated during initial KEX; bz3375

ok markus@

OpenBSD-Commit-ID: 46e75e8dfa2c813781805b842580dcfbd888cf29

3 years agoupstream: Fix signature algorithm selection logic for
djm@openbsd.org [Thu, 6 Jan 2022 21:55:23 +0000 (21:55 +0000)] 
upstream: Fix signature algorithm selection logic for

UpdateHostkeys on the server side. The previous code tried to prefer RSA/SHA2
for hostkey proofs of RSA keys, but missed some cases. This will use RSA/SHA2
signatures for RSA keys if the client proposed these algorithms in initial
KEX. bz3375

Mostly by Dmitry Belyavskiy with some tweaks by me.

ok markus@

OpenBSD-Commit-ID: c17ba0c3236340d2c6a248158ebed042ac6a8029

3 years agoupstream: convert ssh, sshd mainloops from select() to poll();
djm@openbsd.org [Thu, 6 Jan 2022 21:48:38 +0000 (21:48 +0000)] 
upstream: convert ssh, sshd mainloops from select() to poll();

feedback & ok deraadt@ and markus@ has been in snaps for a few months

OpenBSD-Commit-ID: a77e16a667d5b194dcdb3b76308b8bba7fa7239c

3 years agoupstream: prepare for conversion of ssh, sshd mainloop from
djm@openbsd.org [Thu, 6 Jan 2022 21:46:23 +0000 (21:46 +0000)] 
upstream: prepare for conversion of ssh, sshd mainloop from

select() to poll() by moving FD_SET construction out of channel handlers into
separate functions. ok markus

OpenBSD-Commit-ID: 937fbf2a4de12b19fb9d5168424e206124807027

3 years agoupstream: add a comment so I don't make this mistake again
djm@openbsd.org [Wed, 5 Jan 2022 21:54:37 +0000 (21:54 +0000)] 
upstream: add a comment so I don't make this mistake again

OpenBSD-Commit-ID: 69c7f2362f9de913bb29b6318580c5a1b52c921e

3 years agoupstream: fix cut-and-pasto in error message
djm@openbsd.org [Wed, 5 Jan 2022 21:50:00 +0000 (21:50 +0000)] 
upstream: fix cut-and-pasto in error message

OpenBSD-Commit-ID: 4cc5c619e4b456cd2e9bb760d17e3a9c84659198

3 years agoupstream: select all RSA hostkey algorithms for UpdateHostkeys tests,
djm@openbsd.org [Wed, 5 Jan 2022 08:25:05 +0000 (08:25 +0000)] 
upstream: select all RSA hostkey algorithms for UpdateHostkeys tests,

not just RSA-SHA1

OpenBSD-Regress-ID: b40e62b65863f2702a0c10aca583b2fe76772bd8

3 years agoupstream: regress test both sshsig message hash algorithms, possible
djm@openbsd.org [Wed, 5 Jan 2022 04:56:15 +0000 (04:56 +0000)] 
upstream: regress test both sshsig message hash algorithms, possible

now because the algorithm is controllable via the CLI

OpenBSD-Regress-ID: 0196fa87acc3544b2b4fd98de844a571cb09a39f

3 years agoupstream: allow selection of hash at sshsig signing time; code
djm@openbsd.org [Wed, 5 Jan 2022 04:50:11 +0000 (04:50 +0000)] 
upstream: allow selection of hash at sshsig signing time; code

already supported either sha512 (default) or sha256, but plumbing wasn't
there mostly by Linus Nordberg

OpenBSD-Commit-ID: 1b536404b9da74a84b3a1c8d0b05fd564cdc96cd

3 years agoupstream: add missing -O option to usage() for ssh-keygen -Y sign;
djm@openbsd.org [Wed, 5 Jan 2022 04:27:54 +0000 (04:27 +0000)] 
upstream: add missing -O option to usage() for ssh-keygen -Y sign;

from Linus Nordberg

OpenBSD-Commit-ID: 4e78feb4aa830727ab76bb2e3d940440ae1d7af0

3 years agoupstream: move sig_process_opts() to before sig_sign(); no
djm@openbsd.org [Wed, 5 Jan 2022 04:27:01 +0000 (04:27 +0000)] 
upstream: move sig_process_opts() to before sig_sign(); no

functional code change

OpenBSD-Commit-ID: da02d61f5464f72b4e8b299f83e93c3b657932f9

3 years agoupstream: regression test for find-principals NULL deref; from Fabian
djm@openbsd.org [Wed, 5 Jan 2022 04:10:39 +0000 (04:10 +0000)] 
upstream: regression test for find-principals NULL deref; from Fabian

Stelzer

OpenBSD-Regress-ID: f845a8632a5a7d5ae26978004c93e796270fd3e5

3 years agoupstream: NULL deref when using find-principals when matching an
djm@openbsd.org [Wed, 5 Jan 2022 04:02:42 +0000 (04:02 +0000)] 
upstream: NULL deref when using find-principals when matching an

allowed_signers line that contains a namespace restriction, but no
restriction specified on the command-line; report and fix from Fabian Stelzer

OpenBSD-Commit-ID: 4a201b86afb668c908d1a559c6af456a61f4b145

3 years agoupstream: Log command invocation while debugging.
dtucker@openbsd.org [Tue, 4 Jan 2022 08:38:53 +0000 (08:38 +0000)] 
upstream: Log command invocation while debugging.

This will aid in manually reproducing failing commands.

OpenBSD-Regress-ID: b4aba8d5ac5675ceebeeeefa3261ce344e67333a

3 years agoAlways save config.h as build artifact.
Darren Tucker [Sat, 25 Dec 2021 23:31:15 +0000 (10:31 +1100)] 
Always save config.h as build artifact.

Should allow better comparison between failing and succeeding test
platforms.

3 years agoAdd OpenBSD 7.0 target. Retire 6.8.
Darren Tucker [Sat, 25 Dec 2021 05:42:51 +0000 (16:42 +1100)] 
Add OpenBSD 7.0 target.  Retire 6.8.

3 years agoupstream: spelling
jsg@openbsd.org [Sat, 1 Jan 2022 05:55:06 +0000 (05:55 +0000)] 
upstream: spelling

OpenBSD-Commit-ID: c63e43087a64d0727af13409c708938e05147b62

3 years agoupstream: unbreak test: was picking up system ssh-add instead of the
djm@openbsd.org [Tue, 4 Jan 2022 07:20:33 +0000 (07:20 +0000)] 
upstream: unbreak test: was picking up system ssh-add instead of the

one supposedly being tested. Spotted by dtucker and using his VM zoo (which
includes some systems old enough to lack ed25519 key support)

OpenBSD-Regress-ID: 7976eb3df11cc2ca3af91030a6a8c0cef1590bb5

3 years agoupstream: fix memleak in process_extension(); oss-fuzz issue #42719
djm@openbsd.org [Sat, 1 Jan 2022 04:18:06 +0000 (04:18 +0000)] 
upstream: fix memleak in process_extension(); oss-fuzz issue #42719

OpenBSD-Commit-ID: d8d49f840162fb7b8949e3a5adb8107444b6de1e

3 years agoupstream: spelling ok dtucker@
jsg@openbsd.org [Sat, 1 Jan 2022 01:55:30 +0000 (01:55 +0000)] 
upstream: spelling ok dtucker@

OpenBSD-Commit-ID: bfc7ba74c22c928de2e257328b3f1274a3dfdf19

3 years agoupstream: split method list search functionality from
djm@openbsd.org [Sun, 26 Dec 2021 23:34:41 +0000 (23:34 +0000)] 
upstream: split method list search functionality from

authmethod_lookup() into a separate authmethod_byname(), for cases where we
don't need to check whether a method is enabled, etc.

use this to fix the "none" authentication method regression reported
by Nam Nguyen via bugs@

ok deraadt@

OpenBSD-Commit-ID: 8cd188dc3a83aa8abe5b7693e762975cd8ea8a17

3 years agoupstream: sort -H and -h in SYNOPSIS/usage(); tweak the -H text;
jmc@openbsd.org [Wed, 22 Dec 2021 06:56:41 +0000 (06:56 +0000)] 
upstream: sort -H and -h in SYNOPSIS/usage(); tweak the -H text;

ok djm

OpenBSD-Commit-ID: 90721643e41e9e09deb5b776aaa0443456ab0965

3 years agoUse SHA.*_HMAC_BLOCK_SIZE if needed.
Darren Tucker [Wed, 22 Dec 2021 08:33:10 +0000 (19:33 +1100)] 
Use SHA.*_HMAC_BLOCK_SIZE if needed.

If the platform has a native SHA2, does not define SHA.*_BLOCK_LENGTH
but does define SHA.*_HMAC_BLOCK_SIZE (eg Solaris) then use the latter.
Should fix --without-openssl build on Solaris.

3 years agoremove sys/param.h in -portable, after upstream
Damien Miller [Tue, 21 Dec 2021 22:02:50 +0000 (09:02 +1100)] 
remove sys/param.h in -portable, after upstream

3 years agoadd agent-restrict.sh file, missed in last commit
Damien Miller [Mon, 20 Dec 2021 02:05:20 +0000 (13:05 +1100)] 
add agent-restrict.sh file, missed in last commit

3 years agoupstream: regression test for destination restrictions in ssh-agent
djm@openbsd.org [Sun, 19 Dec 2021 22:20:12 +0000 (22:20 +0000)] 
upstream: regression test for destination restrictions in ssh-agent

OpenBSD-Regress-ID: 3c799d91e736b1753b4a42d80c42fc40de5ad33d

3 years agoupstream: Make use of ntests variable, pointed out by clang 13.
anton@openbsd.org [Sat, 18 Dec 2021 06:53:59 +0000 (06:53 +0000)] 
upstream: Make use of ntests variable, pointed out by clang 13.

OpenBSD-Regress-ID: 4241a3d21bdfa1630ed429b6d4fee51038d1be72

3 years agoupstream: sys/param.h cleanup, mostly using MINIMUM() and
deraadt@openbsd.org [Tue, 14 Dec 2021 21:25:27 +0000 (21:25 +0000)] 
upstream: sys/param.h cleanup, mostly using MINIMUM() and

<limits.h> ok dtucker

OpenBSD-Regress-ID: 172a4c45d3bcf92fa6cdf6c4b9db3f1b3abe4db0

3 years agoupstream: document host-bound publickey authentication
djm@openbsd.org [Sun, 19 Dec 2021 22:15:42 +0000 (22:15 +0000)] 
upstream: document host-bound publickey authentication

OpenBSD-Commit-ID: ea6ed91779a81f06d961e30ecc49316b3d71961b

3 years agoupstream: document agent protocol extensions
djm@openbsd.org [Sun, 19 Dec 2021 22:15:21 +0000 (22:15 +0000)] 
upstream: document agent protocol extensions

OpenBSD-Commit-ID: 09e8bb391bbaf24c409b75a4af44e0cac65405a7

3 years agoupstream: PubkeyAuthentication=yes|no|unbound|host-bound
djm@openbsd.org [Sun, 19 Dec 2021 22:14:47 +0000 (22:14 +0000)] 
upstream: PubkeyAuthentication=yes|no|unbound|host-bound

Allow control over which pubkey methods are used. Added out of
concern that some hardware devices may have difficulty signing
the longer pubkey authentication challenges. This provides a
way for them to disable the extension. It's also handy for
testing.

feedback / ok markus@

OpenBSD-Commit-ID: ee52580db95c355cf6d563ba89974c210e603b1a

3 years agoupstream: document destination-constrained keys
djm@openbsd.org [Sun, 19 Dec 2021 22:14:12 +0000 (22:14 +0000)] 
upstream: document destination-constrained keys

feedback / ok markus@

OpenBSD-Commit-ID: cd8c526c77268f6d91c06adbee66b014d22d672e

3 years agoupstream: Use hostkey parsed from hostbound userauth request
djm@openbsd.org [Sun, 19 Dec 2021 22:13:55 +0000 (22:13 +0000)] 
upstream: Use hostkey parsed from hostbound userauth request

Require host-bound userauth requests for forwarded SSH connections.

The hostkey parsed from the host-bound userauth request is now checked
against the most recently bound session ID / hostkey on the agent socket
and the signature refused if they do not match.

ok markus@

OpenBSD-Commit-ID: d69877c9a3bd8d1189a5dbdeceefa432044dae02

3 years agoupstream: agent support for parsing hostkey-bound signatures
djm@openbsd.org [Sun, 19 Dec 2021 22:13:33 +0000 (22:13 +0000)] 
upstream: agent support for parsing hostkey-bound signatures

Allow parse_userauth_request() to work with blobs from
publickey-hostbound-v00@openssh.com userauth attempts.

Extract hostkey from these blobs.

ok markus@

OpenBSD-Commit-ID: 81c064255634c1109477dc65c3e983581d336df8

3 years agoupstream: EXT_INFO negotiation of hostbound pubkey auth
djm@openbsd.org [Sun, 19 Dec 2021 22:13:12 +0000 (22:13 +0000)] 
upstream: EXT_INFO negotiation of hostbound pubkey auth

the EXT_INFO packet gets a new publickey-hostbound@openssh.com to
advertise the hostbound public key method.

Client side support to parse this feature flag and set the kex->flags
indicator if the expected version is offered (currently "0").

ok markus@

OpenBSD-Commit-ID: 4cdb2ca5017ec1ed7a9d33bda95c1d6a97b583b0

3 years agoupstream: client side of host-bound pubkey authentication
djm@openbsd.org [Sun, 19 Dec 2021 22:12:54 +0000 (22:12 +0000)] 
upstream: client side of host-bound pubkey authentication

Add kex->flags member to enable the publickey-hostbound-v00@openssh.com
authentication method.

Use the new hostbound method in client if the kex->flags flag was set,
and include the inital KEX hostkey in the userauth request.

Note: nothing in kex.c actually sets the new flag yet

ok markus@

OpenBSD-Commit-ID: 5a6fce8c6c8a77a80ee1526dc467d91036a5910d

3 years agoupstream: sshd side of hostbound public key auth
djm@openbsd.org [Sun, 19 Dec 2021 22:12:30 +0000 (22:12 +0000)] 
upstream: sshd side of hostbound public key auth

This is identical to the standard "publickey" method, but it also includes
the initial server hostkey in the message signed by the client.

feedback / ok markus@

OpenBSD-Commit-ID: 7ea01bb7238a560c1bfb426fda0c10a8aac07862

3 years agoupstream: prepare for multiple names for authmethods
djm@openbsd.org [Sun, 19 Dec 2021 22:12:07 +0000 (22:12 +0000)] 
upstream: prepare for multiple names for authmethods

allow authentication methods to have one additional name beyond their
primary name.

allow lookup by this synonym

Use primary name for authentication decisions, e.g. for
PermitRootLogin=publickey

Pass actual invoked name to the authmethods, so they can tell whether they
were requested via the their primary name or synonym.

ok markus@

OpenBSD-Commit-ID: 9e613fcb44b8168823195602ed3d09ffd7994559

3 years agoupstream: ssh-agent side of destination constraints
djm@openbsd.org [Sun, 19 Dec 2021 22:11:39 +0000 (22:11 +0000)] 
upstream: ssh-agent side of destination constraints

Gives ssh-agent the ability to parse restrict-destination-v00@openssh.com
constraints and to apply them to keys.

Check constraints against the hostkeys recorded for a SocketEntry when
attempting a signature, adding, listing or deleting keys. Note that
the "delete all keys" request will remove constrained keys regardless of
location.

feedback Jann Horn & markus@
ok markus@

OpenBSD-Commit-ID: 84a7fb81106c2d609a6ac17469436df16d196319

3 years agoupstream: ssh-add side of destination constraints
djm@openbsd.org [Sun, 19 Dec 2021 22:11:06 +0000 (22:11 +0000)] 
upstream: ssh-add side of destination constraints

Have ssh-add accept a list of "destination constraints" that allow
restricting where keys may be used in conjunction with a ssh-agent/ssh
that supports session ID/hostkey binding.

Constraints are specified as either "[user@]host-pattern" or
"host-pattern>[user@]host-pattern".

The first form permits a key to be used to authenticate as the
specified user to the specified host.

The second form permits a key that has previously been permitted
for use at a host to be available via a forwarded agent to an
additional host.

For example, constraining a key with "user1@host_a" and
"host_a>host_b". Would permit authentication as "user1" at
"host_a", and allow the key to be available on an agent forwarded
to "host_a" only for authentication to "host_b". The key would not
be visible on agent forwarded to other hosts or usable for
authentication there.

Internally, destination constraints use host keys to identify hosts.
The host patterns are used to obtain lists of host keys for that
destination that are communicated to the agent. The user/hostkeys are
encoded using a new restrict-destination-v00@openssh.com key
constraint.

host keys are looked up in the default client user/system known_hosts
files. It is possible to override this set on the command-line.

feedback Jann Horn & markus@
ok markus@

OpenBSD-Commit-ID: 6b52cd2b637f3d29ef543f0ce532a2bce6d86af5

3 years agoupstream: ssh-add side of destination constraints
djm@openbsd.org [Sun, 19 Dec 2021 22:10:24 +0000 (22:10 +0000)] 
upstream: ssh-add side of destination constraints

Have ssh-add accept a list of "destination constraints" that allow
restricting where keys may be used in conjunction with a ssh-agent/ssh
that supports session ID/hostkey binding.

Constraints are specified as either "[user@]host-pattern" or
"host-pattern>[user@]host-pattern".

The first form permits a key to be used to authenticate as the
specified user to the specified host.

The second form permits a key that has previously been permitted
for use at a host to be available via a forwarded agent to an
additional host.

For example, constraining a key with "user1@host_a" and
"host_a>host_b". Would permit authentication as "user1" at
"host_a", and allow the key to be available on an agent forwarded
to "host_a" only for authentication to "host_b". The key would not
be visible on agent forwarded to other hosts or usable for
authentication there.

Internally, destination constraints use host keys to identify hosts.
The host patterns are used to obtain lists of host keys for that
destination that are communicated to the agent. The user/hostkeys are
encoded using a new restrict-destination-v00@openssh.com key
constraint.

host keys are looked up in the default client user/system known_hosts
files. It is possible to override this set on the command-line.

feedback Jann Horn & markus@
ok markus@

OpenBSD-Commit-ID: ef47fa9ec0e3c2a82e30d37ef616e245df73163e

3 years agoupstream: ssh-agent side of binding
djm@openbsd.org [Sun, 19 Dec 2021 22:09:23 +0000 (22:09 +0000)] 
upstream: ssh-agent side of binding

record session ID/hostkey/forwarding status for each active socket.

Attempt to parse data-to-be-signed at signature request time and extract
session ID from the blob if it is a pubkey userauth request.

ok markus@

OpenBSD-Commit-ID: a80fd41e292b18b67508362129e9fed549abd318

3 years agoupstream: ssh client side of binding
djm@openbsd.org [Sun, 19 Dec 2021 22:08:48 +0000 (22:08 +0000)] 
upstream: ssh client side of binding

send session ID, hostkey, signature and a flag indicating whether the
agent connection is being forwarded to ssh agent each time a connection
is opened via a new "session-bind@openssh.com" agent extension.

ok markus@

OpenBSD-Commit-ID: 2f154844fe13167d3ab063f830d7455fcaa99135

3 years agoupstream: Record session ID, host key and sig at intital KEX
djm@openbsd.org [Sun, 19 Dec 2021 22:08:06 +0000 (22:08 +0000)] 
upstream: Record session ID, host key and sig at intital KEX

These will be used later for agent session ID / hostkey binding

ok markus@

OpenBSD-Commit-ID: a9af29e33772b18e3e867c6fa8ab35e1694a81fe

3 years agoupstream: better error message for FIDO keys when we can't match
djm@openbsd.org [Tue, 7 Dec 2021 22:06:45 +0000 (22:06 +0000)] 
upstream: better error message for FIDO keys when we can't match

them to a token

OpenBSD-Commit-ID: 58255c2a1980088f4ed144db67d879ada2607650

3 years agoCorrect value for IPTOS_DSCP_LE.
Darren Tucker [Tue, 14 Dec 2021 23:50:33 +0000 (10:50 +1100)] 
Correct value for IPTOS_DSCP_LE.

It needs to allow for the preceeding two ECN bits.  From daisuke.higashi
at gmail.com via OpenSSH bz#3373, ok claudio@, job@, djm@.

3 years agoIncrease timeout for test step.
Darren Tucker [Fri, 10 Dec 2021 00:57:30 +0000 (11:57 +1100)] 
Increase timeout for test step.

3 years agoUpdate the list of tests that don't work on Minix.
Darren Tucker [Thu, 9 Dec 2021 23:27:27 +0000 (10:27 +1100)] 
Update the list of tests that don't work on Minix.

While there, remove CC (configure will now find clang) and make the test
list easier to update via cut and paste.

3 years agoAdd minix host tuple.
Darren Tucker [Thu, 9 Dec 2021 23:12:57 +0000 (10:12 +1100)] 
Add minix host tuple.

Define SETEUID_BREAKS_SETUID for it which should make privsep work.

3 years agoupstream: fix unintended sizeof pointer in debug path ok markus@
jsg@openbsd.org [Sun, 5 Dec 2021 12:28:27 +0000 (12:28 +0000)] 
upstream: fix unintended sizeof pointer in debug path ok markus@

OpenBSD-Commit-ID: b9c0481ffc0cd801e0840e342e6a282a85aac93c

3 years agoupstream: RSA/SHA-1 is not used by default anymore on the server
naddy@openbsd.org [Sat, 4 Dec 2021 00:05:39 +0000 (00:05 +0000)] 
upstream: RSA/SHA-1 is not used by default anymore on the server

OpenBSD-Commit-ID: 64abef6cfc3e53088225f6b8a1dcd86d52dc8353

3 years agoupstream: hash full host:port when asked to hash output, fixes hashes
djm@openbsd.org [Thu, 2 Dec 2021 23:45:36 +0000 (23:45 +0000)] 
upstream: hash full host:port when asked to hash output, fixes hashes

for non- default ports. bz3367 ok dtucker@

OpenBSD-Commit-ID: 096021cc847da7318ac408742f2d0813ebe9aa73

3 years agoupstream: improve the testing of credentials against inserted FIDO
djm@openbsd.org [Thu, 2 Dec 2021 23:23:13 +0000 (23:23 +0000)] 
upstream: improve the testing of credentials against inserted FIDO

keys a little more: ask the token whether a particular key belongs to it in
cases where the token support on-token user- verification (e.g. biometrics)
rather than just assuming that it will accept it.

Will reduce spurious "Confirm user presence" notifications for key
handles that relate to FIDO keys that are not currently inserted in at
least some cases.

Motivated by bz3366; by Pedro Martelletto

OpenBSD-Commit-ID: ffac7f3215842397800e1ae2e20229671a55a63d

3 years agoupstream: move check_sk_options() up so we can use it earlier
djm@openbsd.org [Thu, 2 Dec 2021 22:40:05 +0000 (22:40 +0000)] 
upstream: move check_sk_options() up so we can use it earlier

OpenBSD-Commit-ID: 67fe98ba1c846d22035279782c4664c1865763b4

3 years agoupstream: ssh-rsa is no longer in the default for
dtucker@openbsd.org [Thu, 2 Dec 2021 22:35:05 +0000 (22:35 +0000)] 
upstream: ssh-rsa is no longer in the default for

PubkeyAcceptedAlgorithms.

OpenBSD-Commit-ID: 34a9e1bc30966fdcc922934ae00f09f2596cd73c

3 years agoupstream: don't put the tty into raw mode when SessionType=none, avoids
djm@openbsd.org [Thu, 2 Dec 2021 02:44:44 +0000 (02:44 +0000)] 
upstream: don't put the tty into raw mode when SessionType=none, avoids

^c being unable to kill such a session. bz3360; ok dtucker@

OpenBSD-Commit-ID: 83960c433052303b643b4c380ae2f799ac896f65

3 years agoprevious commit broke bcrypt_pbkdf()
Damien Miller [Mon, 29 Nov 2021 03:11:03 +0000 (14:11 +1100)] 
previous commit broke bcrypt_pbkdf()

Accidentally reverted part of the conversion to use SHA512 from SUPERCOP
instead of OpenBSD-style libc SHA512.

3 years agoFix typo in Neils' name.
Darren Tucker [Mon, 29 Nov 2021 03:03:19 +0000 (14:03 +1100)] 
Fix typo in Neils' name.

3 years agosync bcrypt-related files with OpenBSD
Damien Miller [Mon, 29 Nov 2021 01:30:22 +0000 (12:30 +1100)] 
sync bcrypt-related files with OpenBSD

The main change is that Niels Provos kindly agreed to rescind the
BSD license advertising clause, shifting them to the 3-term BSD
license.

This was the last thing in OpenSSH that used the advertising clause.

3 years agodepend
Damien Miller [Mon, 29 Nov 2021 01:29:29 +0000 (12:29 +1100)] 
depend

3 years agoupstream: sshsig: return "key not found" when searching empty files
djm@openbsd.org [Sun, 28 Nov 2021 07:21:26 +0000 (07:21 +0000)] 
upstream: sshsig: return "key not found" when searching empty files

rather than "internal error"

OpenBSD-Commit-ID: e2ccae554c78d7a7cd33fc5d217f35be7e2507ed

3 years agoupstream: ssh-keygen -Y match-principals doesn't accept any -O
djm@openbsd.org [Sun, 28 Nov 2021 07:15:10 +0000 (07:15 +0000)] 
upstream: ssh-keygen -Y match-principals doesn't accept any -O

options at present, so don't say otherwise in SYNOPSIS; spotted jmc@

OpenBSD-Commit-ID: 9cc43a18f4091010741930b48b3db2f2e4f1d35c

3 years agoupstream: fix indenting in last commit
djm@openbsd.org [Sun, 28 Nov 2021 07:14:29 +0000 (07:14 +0000)] 
upstream: fix indenting in last commit

OpenBSD-Commit-ID: 8b9ba989815d0dec1fdf5427a4a4b58eb9cac4d2

3 years agoupstream: missing initialisation for oerrno
djm@openbsd.org [Sun, 28 Nov 2021 07:10:18 +0000 (07:10 +0000)] 
upstream: missing initialisation for oerrno

OpenBSD-Commit-ID: 05d646bba238080259bec821c831a6f0b48d2a95

3 years agoCorrect ifdef to activate poll() only if needed.
Darren Tucker [Sun, 28 Nov 2021 04:31:37 +0000 (15:31 +1100)] 
Correct ifdef to activate poll() only if needed.

3 years agoupstream: whitespac e
djm@openbsd.org [Sat, 27 Nov 2021 07:23:35 +0000 (07:23 +0000)] 
upstream: whitespac e

OpenBSD-Regress-ID: b9511d41568056bda489e13524390167889908f8

3 years agoupstream: regression test for match-principals. Mostly by Fabian
djm@openbsd.org [Sat, 27 Nov 2021 07:20:58 +0000 (07:20 +0000)] 
upstream: regression test for match-principals. Mostly by Fabian

Stelzer

OpenBSD-Regress-ID: ced0bec89af90935103438986bbbc4ad1df9cfa7

3 years agoupstream: Add ssh-keygen -Y match-principals operation to perform
djm@openbsd.org [Sat, 27 Nov 2021 07:14:46 +0000 (07:14 +0000)] 
upstream: Add ssh-keygen -Y match-principals operation to perform

matching of principals names against an allowed signers file.

Requested by and mostly written by Fabian Stelzer, towards a TOFU
model for SSH signatures in git. Some tweaks by me.

"doesn't bother me" deraadt@

OpenBSD-Commit-ID: 8d1b71f5a4127bc5e10a880c8ea6053394465247

3 years agoupstream: debug("func: ...") -> debug_f("...")
djm@openbsd.org [Thu, 25 Nov 2021 23:02:24 +0000 (23:02 +0000)] 
upstream: debug("func: ...") -> debug_f("...")

OpenBSD-Commit-ID: d58494dc05c985326a895adfbe16fbd5bcc54347

3 years agoAllow for fd = -1 in compat ppoll overflow check.
Darren Tucker [Fri, 19 Nov 2021 07:53:46 +0000 (18:53 +1100)] 
Allow for fd = -1 in compat ppoll overflow check.

Fixes tests on at least FreeBSD 6, possibly others.

3 years agoDon't auto-enable Capsicum sandbox on FreeBSD 9/10.
Darren Tucker [Fri, 19 Nov 2021 05:01:51 +0000 (16:01 +1100)] 
Don't auto-enable Capsicum sandbox on FreeBSD 9/10.

Since we changed from select() to ppoll() tests have been failing.
This seems to be because FreeBSD 10 (and presumably 9) do not allow
ppoll() in the privsep process and sshd will fail with "Not permitted in
capability mode".  Setting CAP_EVENT on the FDs doesn't help, but weirdly,
poll() works without that.  Those versions are EOL so this situation is
unlikely to change.

3 years agoupstream: regression test for ssh-keygen -Y find-principals fix; from
djm@openbsd.org [Thu, 18 Nov 2021 03:53:48 +0000 (03:53 +0000)] 
upstream: regression test for ssh-keygen -Y find-principals fix; from

Fabian Stelzer ok djm markus

OpenBSD-Regress-ID: 34fe4088854c1a2eb4c0c51cc4676ba24096bac4

3 years agoupstream: less confusing debug message; bz#3365
djm@openbsd.org [Thu, 18 Nov 2021 21:32:11 +0000 (21:32 +0000)] 
upstream: less confusing debug message; bz#3365

OpenBSD-Commit-ID: 836268d3642c2cdc84d39b98d65837f5241e4a50

3 years agoupstream: avoid xmalloc(0) for PKCS#11 keyid for ECDSA keys (we
djm@openbsd.org [Thu, 18 Nov 2021 21:11:01 +0000 (21:11 +0000)] 
upstream: avoid xmalloc(0) for PKCS#11 keyid for ECDSA keys (we

already did this for RSA keys). Avoids fatal errors for PKCS#11 libraries
that return empty keyid, e.g. Microchip ATECC608B "cryptoauthlib"; bz#3364

OpenBSD-Commit-ID: 054d4dc1d6a99a2e6f8eebc48207b534057c154d

3 years agoupstream: ssh-keygen -Y find-principals was verifying key validity
djm@openbsd.org [Thu, 18 Nov 2021 03:50:41 +0000 (03:50 +0000)] 
upstream: ssh-keygen -Y find-principals was verifying key validity

when using ca certs but not with simple key lifetimes within the allowed
signers file.

Since it returns the first keys principal it finds this could
result in a principal with an expired key even though a valid
one is just below.

patch from Fabian Stelzer; feedback/ok djm markus

OpenBSD-Commit-ID: b108ed0a76b813226baf683ab468dc1cc79e0905

3 years agoCorrect calculation of tv_nsec in poll().
Darren Tucker [Thu, 18 Nov 2021 12:44:07 +0000 (23:44 +1100)] 
Correct calculation of tv_nsec in poll().

3 years agoAdd compat implementation of ppoll using pselect.
Darren Tucker [Thu, 18 Nov 2021 12:11:37 +0000 (23:11 +1100)] 
Add compat implementation of ppoll using pselect.

3 years agoPut poll.h inside ifdef HAVE_POLL_H.
Darren Tucker [Thu, 18 Nov 2021 12:05:34 +0000 (23:05 +1100)] 
Put poll.h inside ifdef HAVE_POLL_H.

3 years agoupstream: check for POLLHUP wherever we check for POLLIN
djm@openbsd.org [Thu, 18 Nov 2021 03:31:44 +0000 (03:31 +0000)] 
upstream: check for POLLHUP wherever we check for POLLIN

OpenBSD-Commit-ID: 6aa6f3ec6b17c3bd9bfec672a917f003a76d93e5

3 years agoupstream: fd leak in sshd listen loop error path; from Gleb
djm@openbsd.org [Thu, 18 Nov 2021 03:07:59 +0000 (03:07 +0000)] 
upstream: fd leak in sshd listen loop error path; from Gleb

Smirnoff

OpenBSD-Commit-ID: a7a2be27a690a74bf2381bc16cea38e265657412

3 years agoupstream: check for POLLHUP as well as POLLIN in sshd listen loop;
djm@openbsd.org [Thu, 18 Nov 2021 03:07:20 +0000 (03:07 +0000)] 
upstream: check for POLLHUP as well as POLLIN in sshd listen loop;

ok deraadt millert

OpenBSD-Commit-ID: a4f1244c5a9c2b08dac4f3b1dc22e9d1dc60c587

3 years agoupstream: check for POLLHUP as well as POLLIN, handle transient IO
djm@openbsd.org [Thu, 18 Nov 2021 03:06:03 +0000 (03:06 +0000)] 
upstream: check for POLLHUP as well as POLLIN, handle transient IO

errors as well as half-close on the output side; ok deraadt millert

OpenBSD-Commit-ID: de5c5b9939a37476d256328cbb96305bdecf511e

3 years agoadjust seccomp filter for select->poll conversion
Damien Miller [Wed, 17 Nov 2021 23:16:55 +0000 (10:16 +1100)] 
adjust seccomp filter for select->poll conversion

Needed to add ppoll syscall but also to relax the fallback rlimit
sandbox. Linux poll() fails with EINVAL if npfds > RLIMIT_NOFILE,
so we have to allow a single fd in the rlimit.

3 years agoupdate depends
Damien Miller [Wed, 17 Nov 2021 23:16:44 +0000 (10:16 +1100)] 
update depends

3 years agocompat for timespecsub() and friends
Damien Miller [Wed, 17 Nov 2021 22:26:20 +0000 (09:26 +1100)] 
compat for timespecsub() and friends