Commit Graph

11470 Commits

Author SHA1 Message Date
Darren Tucker 03bd4ed0db Add OpenBSD 7.0 target. Retire 6.8. 2022-01-05 11:48:58 +11:00
jsg@openbsd.org c45a752f0d upstream: spelling
OpenBSD-Commit-ID: c63e43087a64d0727af13409c708938e05147b62
2022-01-04 18:22:46 +11:00
djm@openbsd.org c672f83a89 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
2022-01-04 18:22:37 +11:00
djm@openbsd.org a23698c308 upstream: fix memleak in process_extension(); oss-fuzz issue #42719
OpenBSD-Commit-ID: d8d49f840162fb7b8949e3a5adb8107444b6de1e
2022-01-01 15:19:48 +11:00
jsg@openbsd.org cb885178f3 upstream: spelling ok dtucker@
OpenBSD-Commit-ID: bfc7ba74c22c928de2e257328b3f1274a3dfdf19
2022-01-01 15:19:48 +11:00
djm@openbsd.org 6b977f8080 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
2021-12-27 10:40:22 +11:00
jmc@openbsd.org 0074aa2c8d upstream: sort -H and -h in SYNOPSIS/usage(); tweak the -H text;
ok djm

OpenBSD-Commit-ID: 90721643e41e9e09deb5b776aaa0443456ab0965
2021-12-27 10:40:16 +11:00
Darren Tucker 1c9853a68b 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.
2021-12-23 11:36:08 +11:00
Damien Miller 715c892f0a remove sys/param.h in -portable, after upstream 2021-12-22 09:02:50 +11:00
Damien Miller 7a7c69d8b4 add agent-restrict.sh file, missed in last commit 2021-12-20 13:05:20 +11:00
djm@openbsd.org f539136ca5 upstream: regression test for destination restrictions in ssh-agent
OpenBSD-Regress-ID: 3c799d91e736b1753b4a42d80c42fc40de5ad33d
2021-12-20 12:17:18 +11:00
anton@openbsd.org 6e4980eb8e upstream: Make use of ntests variable, pointed out by clang 13.
OpenBSD-Regress-ID: 4241a3d21bdfa1630ed429b6d4fee51038d1be72
2021-12-20 12:16:49 +11:00
deraadt@openbsd.org 3eead81583 upstream: sys/param.h cleanup, mostly using MINIMUM() and
<limits.h> ok dtucker

OpenBSD-Regress-ID: 172a4c45d3bcf92fa6cdf6c4b9db3f1b3abe4db0
2021-12-20 12:16:49 +11:00
djm@openbsd.org 266678e19e upstream: document host-bound publickey authentication
OpenBSD-Commit-ID: ea6ed91779a81f06d961e30ecc49316b3d71961b
2021-12-20 09:28:08 +11:00
djm@openbsd.org 3d00024b3b upstream: document agent protocol extensions
OpenBSD-Commit-ID: 09e8bb391bbaf24c409b75a4af44e0cac65405a7
2021-12-20 09:28:08 +11:00
djm@openbsd.org c385abf765 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
2021-12-20 09:28:08 +11:00
djm@openbsd.org 34b1e9cc76 upstream: document destination-constrained keys
feedback / ok markus@

OpenBSD-Commit-ID: cd8c526c77268f6d91c06adbee66b014d22d672e
2021-12-20 09:28:08 +11:00
djm@openbsd.org a6d7677c4a 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org baaff0ff43 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org 3e16365a79 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org 94ae0c6f0e 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org 288fd0218d 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org dbb339f015 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
2021-12-20 09:28:07 +11:00
djm@openbsd.org 39f00dcf44 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
2021-12-20 09:27:06 +11:00
djm@openbsd.org ce943912df 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
2021-12-20 09:27:06 +11:00
djm@openbsd.org 5e950d7657 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
2021-12-20 09:25:17 +11:00
djm@openbsd.org 4c1e3ce85e 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
2021-12-20 09:24:42 +11:00
djm@openbsd.org e9497ecf73 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
2021-12-20 09:24:42 +11:00
djm@openbsd.org b42c61d684 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
2021-12-20 09:24:42 +11:00
djm@openbsd.org 26ca33d186 upstream: better error message for FIDO keys when we can't match
them to a token

OpenBSD-Commit-ID: 58255c2a1980088f4ed144db67d879ada2607650
2021-12-20 09:24:42 +11:00
Darren Tucker adb0ea006d 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@.
2021-12-15 10:50:33 +11:00
Darren Tucker 3dafd3fe22 Increase timeout for test step. 2021-12-11 08:43:41 +11:00
Darren Tucker 5aefb05cd5 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.
2021-12-10 10:27:27 +11:00
Darren Tucker 1c09bb1b2e Add minix host tuple.
Define SETEUID_BREAKS_SETUID for it which should make privsep work.
2021-12-10 10:12:57 +11:00
jsg@openbsd.org a218857903 upstream: fix unintended sizeof pointer in debug path ok markus@
OpenBSD-Commit-ID: b9c0481ffc0cd801e0840e342e6a282a85aac93c
2021-12-07 12:30:50 +11:00
naddy@openbsd.org da40355234 upstream: RSA/SHA-1 is not used by default anymore on the server
OpenBSD-Commit-ID: 64abef6cfc3e53088225f6b8a1dcd86d52dc8353
2021-12-07 12:30:50 +11:00
djm@openbsd.org e9c71498a0 upstream: hash full host:port when asked to hash output, fixes hashes
for non- default ports. bz3367 ok dtucker@

OpenBSD-Commit-ID: 096021cc847da7318ac408742f2d0813ebe9aa73
2021-12-03 11:30:30 +11:00
djm@openbsd.org b560120214 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
2021-12-03 10:27:40 +11:00
djm@openbsd.org ca709e27c4 upstream: move check_sk_options() up so we can use it earlier
OpenBSD-Commit-ID: 67fe98ba1c846d22035279782c4664c1865763b4
2021-12-03 10:27:40 +11:00
dtucker@openbsd.org b711bc01a7 upstream: ssh-rsa is no longer in the default for
PubkeyAcceptedAlgorithms.

OpenBSD-Commit-ID: 34a9e1bc30966fdcc922934ae00f09f2596cd73c
2021-12-03 10:27:40 +11:00
djm@openbsd.org dc91ceea33 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
2021-12-02 13:57:50 +11:00
Damien Miller e6e7d2654a previous commit broke bcrypt_pbkdf()
Accidentally reverted part of the conversion to use SHA512 from SUPERCOP
instead of OpenBSD-style libc SHA512.
2021-11-29 14:11:51 +11:00
Darren Tucker c0459588b8 Fix typo in Neils' name. 2021-11-29 14:03:19 +11:00
Damien Miller 158bf854e2 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.
2021-11-29 12:30:22 +11:00
Damien Miller e8976d92a4 depend 2021-11-29 12:29:29 +11:00
djm@openbsd.org 8249afeec0 upstream: sshsig: return "key not found" when searching empty files
rather than "internal error"

OpenBSD-Commit-ID: e2ccae554c78d7a7cd33fc5d217f35be7e2507ed
2021-11-28 18:28:08 +11:00
djm@openbsd.org 9e3227d4db 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
2021-11-28 18:28:08 +11:00
djm@openbsd.org 56db1f4a4c upstream: fix indenting in last commit
OpenBSD-Commit-ID: 8b9ba989815d0dec1fdf5427a4a4b58eb9cac4d2
2021-11-28 18:28:08 +11:00
djm@openbsd.org 50bea24a9a upstream: missing initialisation for oerrno
OpenBSD-Commit-ID: 05d646bba238080259bec821c831a6f0b48d2a95
2021-11-28 18:28:08 +11:00
Darren Tucker 5a0f461904 Correct ifdef to activate poll() only if needed. 2021-11-28 15:31:37 +11:00