summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-agent.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* updated argument name for -P in first synopsis was missed in previous;jmc2020-06-221-2/+2
|
* better terminology for permissions; feedback & ok markus@djm2020-06-221-12/+12
|
* Correct synopsis and usage for the options accepted when passing a commanddtucker2020-06-191-2/+4
| | | | to ssh-agent. ok jmc@
* Restrict ssh-agent from signing web challenges for FIDO keys.djm2020-05-261-10/+100
| | | | | | | | | | | | | | | | | When signing messages in ssh-agent using a FIDO key that has an application string that does not start with "ssh:", ensure that the message being signed is one of the forms expected for the SSH protocol (currently pubkey authentication and sshsig signatures). This prevents ssh-agent forwarding on a host that has FIDO keys attached granting the ability for the remote side to sign challenges for web authentication using those keys too. Note that the converse case of web browsers signing SSH challenges is already precluded because no web RP can have the "ssh:" prefix in the application string that we require. ok markus@
* initialize seconds for debug message; ok djmmarkus2020-03-061-2/+2
|
* change explicit_bzero();free() to freezero()jsg2020-02-261-3/+2
| | | | | | | | While freezero() returns early if the pointer is NULL the tests for NULL in callers are left to avoid warnings about passing an uninitialised size argument across a function boundry. ok deraadt@ djm@
* Replace "security key" with "authenticator" in program messages.naddy2020-02-061-3/+3
| | | | | | | This replaces "security key" in error/usage/verbose messages and distinguishes between "authenticator" and "authenticator-hosted key". ok djm@
* process security key provider via realpath() in agent, avoidsdjm2020-01-251-7/+19
| | | | | | | malicious client from being able to cause agent to load arbitrary libraries into ssh-sk-helper. reported by puck AT puckipedia.com; ok markus
* expose PKCS#11 key labels/X.509 subjects as commentsdjm2020-01-251-6/+13
| | | | | | | | | | | Extract the key label or X.509 subject string when PKCS#11 keys are retrieved from the token and plumb this through to places where it may be used as a comment. based on https://github.com/openssh/openssh-portable/pull/138 by Danielle Church feedback and ok markus@
* Replace all calls to signal(2) with a wrapper around sigaction(2).dtucker2020-01-231-5/+5
| | | | | | This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations.
* use ssh-sk-helper for all security key signing operationsdjm2019-12-131-140/+20
| | | | | | | | | This extracts and refactors the client interface for ssh-sk-helper from ssh-agent and generalises it for use by the other programs. This means that most OpenSSH tools no longer need to link against libfido2 or directly interact with /dev/uhid* requested by, feedback and ok markus@
* revert previous: naddy pointed out what's meant to happen. rethink needed...jmc2019-11-191-3/+4
|
* -c and -s do not make sense with -k; reshuffle -k into the main synopsis/usage;jmc2019-11-191-4/+3
| | | | ok djm
* additional missing stdarg.h includes when built without WITH_OPENSSL; ok djm@naddy2019-11-181-1/+2
|
* always use ssh-sk-helper, even for the internal USB HID support.djm2019-11-161-33/+11
| | | | | | This avoid the need for a wpath pledge in ssh-agent. reported by jmc@
* unshield security key privkey before attempting signature indjm2019-11-151-4/+16
| | | | agent. spotted by dtucker@
* don't consult dlopen whitelist for internal security key provider;djm2019-11-151-2/+4
| | | | spotted by dtucker@
* show the "please touch your security key" notifier when using thedjm2019-11-151-9/+15
| | | | (default) build-in security key support.
* directly support U2F/FIDO2 security keys in OpenSSH by linkingdjm2019-11-141-1/+6
| | | | | | against the (previously external) USB HID middleware. The dlopen() capability still exists for alternate middlewares, e.g. for Bluetooth, NFC and test/debugging.
* fix shield/unshield for xmss keys:markus2019-11-131-5/+5
| | | | | | | | - in ssh-agent we need to delay the call to shield until we have received key specific options. - when serializing xmss keys for shield we need to deal with all optional components (e.g. state might not be loaded). ok djm@
* security keys typically need to be tapped/touched in order to performdjm2019-11-121-2/+11
| | | | | | | a signature operation. Notify the user when this is expected via the TTY (if available) or $SSH_ASKPASS if we can. ok markus@
* enable ed25519 support; ok djmmarkus2019-11-121-2/+2
|
* Refactor signing - use sshkey_sign for everything, including the newdjm2019-10-311-3/+4
| | | | | | | | | | | U2F signatures. Don't use sshsk_ecdsa_sign() directly, instead make it reachable via sshkey_sign() like all other signature operations. This means that we need to add a provider argument to sshkey_sign(), so most of this change is mechanically adding that. Suggested by / ok markus@
* ssh-agent support for U2F/FIDO keysdjm2019-10-311-19/+199
| | | | feedback & ok markus@
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-5/+5
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Add protection for private keys at rest in RAM against speculationdjm2019-06-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | and memory sidechannel attacks like Spectre, Meltdown, Rowhammer and Rambleed. This change encrypts private keys when they are not in use with a symmetic key that is derived from a relatively large "prekey" consisting of random data (currently 16KB). Attackers must recover the entire prekey with high accuracy before they can attempt to decrypt the shielded private key, but the current generation of attacks have bit error rates that, when applied cumulatively to the entire prekey, make this unlikely. Implementation-wise, keys are encrypted "shielded" when loaded and then automatically and transparently unshielded when used for signatures or when being saved/serialised. Hopefully we can remove this in a few years time when computer architecture has become less unsafe. been in snaps for a bit already; thanks deraadt@ ok dtucker@ deraadt@
* process agent requests for RSA certificate private keys using correctdjm2019-06-141-1/+6
| | | | | signature algorithm when requested. Patch from Jakub Jelen in bz3016 ok dtucker markus
* Replace calls to ssh_malloc_init() by a static init of malloc_options.otto2019-06-061-2/+1
| | | | Prepares for changes in the way malloc is initialized. ok guenther@ dtucker@
* backoff reading messages from active connections when the input bufferdjm2019-01-221-4/+18
| | | | | is too full to read one, or if the output buffer is too full to enqueue a response; feedback & ok dtucker@
* typo in error message; caught by Debian lintian, via Colin Watsondjm2018-11-091-2/+2
|
* implement EMFILE mitigation for ssh-agent: remember the fd rlimitdjm2018-05-111-11/+49
| | | | | | | and stop accepting new connections when it is exceeded (with some grace). Accept is resumed when enough connections are closed. bz#2576. feedback deraadt; ok dtucker@
* lots of typos in comments/docs. Patch from Karsten Weiss after checkingdjm2018-04-101-2/+2
| | | | with codespell tool (https://github.com/lucasdemarchi/codespell)
* don't kill ssh-agent's listening socket entriely if we fail to accept adjm2018-04-091-4/+3
| | | | connection; bz#2837, patch from Lukas Kuster
* Add experimental support for PQC XMSS keys (Extended Hash-Based Signatures)markus2018-02-231-5/+19
| | | | | | | The code is not compiled in by default (see WITH_XMSS in Makefile.inc) Joint work with stefan-lukas_gazdag at genua.eu See https://tools.ietf.org/html/draft-irtf-cfrg-xmss-hash-based-signatures-12 ok djm@
* Drop compatibility hacks for some ancient SSH implementations, includingdjm2018-01-231-3/+1
| | | | | | | | | | ssh.com <=2.* and OpenSSH <= 3.*. These versions were all released in or before 2001 and predate the final SSH RFCs. The hacks in question aren't necessary for RFC- compliant SSH implementations. ok markus@
* downgrade a couple more request parsing errors from process-fatal todjm2017-11-151-10/+23
| | | | | just returning failure, making them consistent with the others that were already like that.
* fix regression in 7.6: failure to parse a signature request messagedjm2017-11-151-3/+6
| | | | | shouldn't be fatal to the process, just the request. Reported by Ron Frederick
* g/c unused variable; make a little more portabledjm2017-07-241-5/+3
|
* switch from select() to poll() for the ssh-agent mainloop; ok markusdjm2017-07-191-125/+183
|
* remove post-SSHv1 removal dead code from rsa.c and merge thedjm2017-07-011-2/+1
| | | | remaining bit that it still used into ssh-rsa.c; ok markus
* flense SSHv1 support from ssh-agent, considerably simplifying itdjm2017-04-301-162/+90
| | | | ok markus
* remove KEY_RSA1djm2017-04-301-16/+12
| | | | ok markus@
* unifdef WITH_SSH1djm2017-04-301-172/+1
| | | | ok markus@
* accidents happen to the best of us; ok djmderaadt2017-03-151-1/+2
|
* fix regression in 7.4: deletion of PKCS#11-hosted keys would faildjm2017-03-151-4/+11
| | | | | unless they were specified by full physical pathname. Report and fix from Jakub Jelen via bz#2682; ok dtucker@
* relax PKCS#11 whitelist a bit to allow libexec as well as libdjm2017-01-041-2/+2
| | | | directories.
* add a whitelist of paths from which ssh-agent will load (viadjm2016-11-301-8/+35
| | | | ssh-pkcs11-helper) a PKCS#11 module; ok markus@
* Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitionsderaadt2016-09-121-5/+4
| | | | | rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker
* fix signed/unsigned errors reported by clang-3.7; adddjm2016-05-021-7/+8
| | | | | | sshbuf_dup_string() to replace a common idiom of strdup(sshbuf_ptr()) with better safety checking; feedback and ok markus@
* Add a function to enable security-related malloc_options. With and okdtucker2016-02-151-1/+2
| | | | deraadt@, something similar has been in the snaps for a while.