summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
AgeCommit message (Collapse)Author
2024-10-18s/Sx/Cm/ for external references; from Domen Puncer Kugler via GHPR501Damien Miller
2024-10-14mention SshdAuthPath option; ok djm@Christian Weisgerber
2024-10-14Split per-connection sshd-session binaryDamien Miller
This splits the user authentication code from the sshd-session binary into a separate sshd-auth binary. This will be executed by sshd-session to complete the user authentication phase of the protocol only. Splitting this code into a separate binary ensures that the crucial pre-authentication attack surface has an entirely disjoint address space from the code used for the rest of the connection. It also yields a small runtime memory saving as the authentication code will be unloaded after thhe authentication phase completes. Joint work with markus@ feedback deraadt@ Tested in snaps since last week
2024-10-13don't start the ObscureKeystrokeTiming mitigations if there has beenDamien Miller
traffic on a X11 forwarding channel recently. Should fix X11 forwarding performance problems when this setting is enabled. Patch from Antonio Larrosa via bz3655
2024-10-12remove duplicate misc.h includeJonathan Gray
ok dtucker@
2024-10-06Turn off finite field (a.k.a modp) Diffie-Hellman key exchange in sshdDamien Miller
by default. Specifically, this removes the diffie-hellman-group* and diffie-hellman-group-exchange-* methods. The client is unchanged and continues to support these methods by default. Finite field Diffie Hellman is slow and computationally expensive for the same security level as Elliptic Curve DH or PQ key agreement while offering no redeeming advantages. ECDH has been specified for the SSH protocol for 15 years and some form of ECDH has been the default key exchange in OpenSSH for the last 14 years. ok markus@
2024-09-26fix previous change to ssh_config Match, which broken on negatedDamien Miller
Matches; spotted by phessler@ ok deraadt@
2024-09-25remove some unused defines; ok djm@Jonathan Gray
2024-09-25remove some unneeded Xo/Xc calls; from evan silbermanJason McIntyre
the original diff had a couple of errors, which i've fixed
2024-09-25fix regression introduced when I switched the "Match" criteria tokeniserDamien Miller
to a more shell-like one. Apparently the old tokeniser (accidentally?) allowed "Match criteria=argument" as well as the "Match criteria argument" syntax that we tested for. People were using this syntax so this adds back support for "Match criteria=argument" bz3739 ok dtucker
2024-09-24some extra paranoia, reminded by jsg@Damien Miller
2024-09-22remove some unused defines; ok djm@Jonathan Gray
2024-09-20remove unneeded semicolons; checked by millert@Jonathan Gray
2024-09-19openssh-9.9Damien Miller
2024-09-16use 64 bit math to avoid signed underflow. upstream code relies onDamien Miller
using -fwrapv to provide defined over/underflow behaviour, but we use -ftrapv to catch integer errors and abort the program. ok dtucker@
2024-09-15minor grammar/sort fixes for refuseconnection; ok djmJason McIntyre
2024-09-15bad whitespace in config dump outputDamien Miller
2024-09-15update the Streamlined NTRU Prime code from the "ref" implementationDamien Miller
in SUPERCOP 20201130 to the "compact" implementation in SUPERCOP 20240808. The new version is substantially faster. Thanks to Daniel J Bernstein for pointing out the new implementation (and of course for writing it). tested in snaps/ok deraadt@
2024-09-15document Match invalid-userDamien Miller
2024-09-15add a "Match invalid-user" predicate to sshd_config Match options.Damien Miller
This allows writing Match conditions that trigger for invalid username. E.g. PerSourcePenalties refuseconnection:90s Match invalid-user RefuseConnection yes Will effectively penalise bots try to guess passwords for bogus accounts, at the cost of implicitly revealing which accounts are invalid. feedback markus@
2024-09-15Add a "refuseconnection" penalty class to sshd_configDamien Miller
PerSourcePenalties This allows penalising connection sources that have had connections dropped by the RefuseConnection option. ok markus@
2024-09-15Add a sshd_config "RefuseConnection" optionDamien Miller
If set, this will terminate the connection at the first authentication request (this is the earliest we can evaluate sshd_config Match blocks) ok markus@
2024-09-15switch sshd_config Match processing to the argv tokeniser too;Damien Miller
ok markus@
2024-09-15switch "Match" directive processing over to the argv stringDamien Miller
tokeniser, making it possible to use shell-like quoting in Match directives, particularly "Match exec". ok markus@
2024-09-15include pathname in some of the ssh-keygen passphrase prompts. HelpsDamien Miller
the user know what's going on when ssh-keygen is invoked via other tools. Requested in GHPR503
2024-09-15Do not apply authorized_keys options when signature verificationDamien Miller
fails. Prevents restrictive key options being incorrectly applied to subsequent keys in authorized_keys. bz3733, ok markus@
2024-09-12Relax absolute path requirement back to what it was prior to OpenSSH 9.8,Damien Miller
which incorrectly required that sshd was started with an absolute path in inetd mode. bz3717, patch from Colin Wilson
2024-09-09document the mlkem768x25519-sha256 key exchange algorithmChristian Weisgerber
2024-09-09pull post-quantum ML-KEM/x25519 key exchange out from compile-timeDamien Miller
flag now than an IANA codepoint has been assigned for the algorithm. Add mlkem768x25519-sha256 in 2nd KexAlgorithms preference slot. ok markus@
2024-09-06make parsing user@host consistently look for the last '@' in theDamien Miller
string rather than the first. This makes it possible to use usernames that contain '@' characters. Prompted by Max Zettlmeißl; feedback/ok millert@
2024-09-04be more strict in parsing key type names. Only allow shortnames (e.gDamien Miller
"rsa") in user-interface code and require full SSH protocol names (e.g. "ssh-rsa") everywhere else. Prompted by bz3725; ok markus@
2024-09-04fix RCSID in outputDamien Miller
2024-09-03envrionment -> environment;Jason McIntyre
2024-09-03allow the "Include" directive to expand the same set of %-tokensDamien Miller
that "Match Exec" and environment variables. ok dtucker@
2024-09-02missing ifdefDamien Miller
2024-09-02Add experimental support for hybrid post-quantum key exchangeDamien Miller
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@
2024-08-23As defined in the RFC, the SSH protocol has negotiable compression supportTheo de Raadt
(which is requested as the name "zlib"). Compression starts very early in the session. Relative early in OpenSSH lifetime, privsep was added to sshd, and this required a shared-memory hack so the two processes could see what was going on in the dataflow. This shared-memory hack was soon recognized as a tremendous complexity risk, because it put libz (which very much trusts it's memory) in a dangerous place, and a new option ("zlib@openssh.com") was added begins compression after authentication (aka delayed-compression). That change also permitted removal of the shared-memory hack. Despite removal from the server, the old "zlib" support remained in the client, to allow negotiation with non-OpenSSH daemons which lack the delayed-compression option. This commit deletes support for the older "zlib" option in the client. It reduces our featureset in a small way, and encourages other servers to move to a better design. The SSH protocol is different enough that compressed-key-material attacks like BEAST are unlikely, but who wants to take the chance? We encourage other ssh servers who care about optional compression support to add delayed-zlib support. (Some already do "zlib@openssh.com") ok djm markus
2024-08-22sntrup761x25519-sha512 now has an IANA codepoint assigned,Damien Miller
so we can make the algorithm available without the @openssh.com suffix too. ok markus@ deraadt@
2024-08-21Import regenerated moduli.Darren Tucker
2024-08-20actually use the length parameter that was passed in rather than aDamien Miller
constant (this makes no difference in practice because the length is always the same); reported by martin AT nmkd.net
2024-08-20place shielded keys (i.e. keys at rest in RAM) into memory allocatedDamien Miller
using mmap(3) with MAP_CONCEAL set. This prevents exposure of the key material in coredumps, etc (this is in addition to other measures we take in this area). ok deraadt@
2024-08-17mention that ed25519 is the default key type generated andDamien Miller
clarify that rsa-sha2-512 is the default signature scheme when RSA is in use. Based on GHPR505 from SebastianRzk
2024-08-17fix minor memory leak in Subsystem option parsing;Damien Miller
from Antonio Larrosa via GHPR515
2024-08-17fix swapping of source and destination addresses in some sshd log messagesDamien Miller
2024-08-15Convert RSA and ECDSA key to the libcrypto EVP_PKEY API. DSA remainsDamien Miller
unconverted as it will be removed within six months. Based on patches originally from Dmitry Belyavskiy, but significantly reworked based on feedback from Bob Beck, Joel Sing and especially Theo Buehler (apologies to anyone I've missed). ok tb@
2024-08-14Reorder calloc argumentsTobias Stoeckmann
The first argument should be the amount, the second argument should be the element size. Fixing this also silences some gcc compiler warnings for portable. Spotted with Benny Baumann (BenBE at geshi dot org). ok djm@
2024-08-14Extend sshbuf validationTobias Stoeckmann
Multiple sshbuf structs can be linked through a parent/child relationship. Make sure that a single sshbuf cannot be its own parent. If this would ever happen, it would result in reference counting issues. This is a cheap way of testing this with very little overhead. It does not detect A->B->A linkages though for performance reason and the fact that it takes a programming error for this to occur anyway. Authored with Benny Baumann (BenBE at geshi dot org). ok djm@
2024-08-14Use freezero for better readabilityTobias Stoeckmann
It has the same meaning as the current pair of calling explicit_bzero and free. Spotted with Benny Baumann (BenBE at geshi dot org). ok djm@
2024-08-14Fix typo in commentTobias Stoeckmann
Spotted with Benny Baumann (BenBE at geshi dot org). ok djm@
2024-07-31add a random amount of time (up to 4 seconds) to the grace login time.David Gwynne
ok deraadt@ djm@