summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshconnect2.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* highly polished whitespace, mostly fixing spaces-for-tab and baddjm2021-04-031-3/+3
| | | | indentation on continuation lines. Prompted by GHPR#185
* make ssh->kex->session_id a sshbuf instead of u_char*/size_t anddjm2021-01-271-15/+9
| | | | | use that instead of global variables containing copies of it. feedback/ok markus@
* remove global variable used to stash compat flags and use thedjm2021-01-271-14/+14
| | | | purpose-built ssh->compat variable instead; feedback/ok markus@
* Rename HostbasedKeyTypes (ssh) and HostbasedAcceptedKeyTypes (sshd) todtucker2021-01-261-3/+3
| | | | | | HostbasedAcceptedAlgorithms, which more accurately reflects its effect. This matches a previous change to PubkeyAcceptedAlgorithms. The previous names are retained as aliases. ok djm@
* make ssh hostbased authentication send the signature algorithm indjm2021-01-251-3/+3
| | | | | | | | its SSH2_MSG_USERAUTH_REQUEST packets instead of the key type. This make HostbasedAcceptedAlgorithms do what it is supposed to - filter on signature algorithm and not key type. spotted with dtucker@ ok markus@
* Rename PubkeyAcceptedKeyTypes keyword to PubkeyAcceptedAlgorithms.dtucker2021-01-221-11/+11
| | | | | | | | While the two were originally equivalent, this actually specifies the signature algorithms that are accepted. Some key types (eg RSA) can be used by multiple algorithms (eg ssh-rsa, rsa-sha2-512) so the old name is becoming increasingly misleading. The old name is retained as an alias. Prompted by bz#3253, help & ok djm@, man page help jmc@
* If a signature operation on a FIDO key fails with a "incorrect PIN"djm2021-01-081-3/+12
| | | | | | | | | | | | | reason and no PIN was initially requested from the user, then request a PIN and retry the operation. This smoothes over a few corner cases including FIDO devices that require PINs for all hosted credentials, biometric FIDO devices that fall back to requiring PIN when reading the biometric failed, devices that don't implement reading credProtect status for downloaded keys and probably a few more cases that I haven't though of yet. ok dtucker@
* Update/replace the experimental post-quantim hybrid key exchangedjm2020-12-291-2/+2
| | | | | | | | | | | | | | | | | | method based on Streamlined NTRU Prime (coupled with X25519). The previous sntrup4591761x25519-sha512@tinyssh.org method is replaced with sntrup761x25519-sha512@openssh.com. Per the authors, sntrup4591761 was replaced almost two years ago by sntrup761. The sntrup761 implementaion, like sntrup4591761 before it, is public domain code extracted from the SUPERCOP cryptography benchmark suite (https://bench.cr.yp.to/supercop.html). Thanks for Daniel J Bernstein for guidance on algorithm selection. Patch from Tobias Heider; feedback & ok markus@ and myself (note this both the updated method and the one that it replaced are disabled by default)
* add a ssh_config KnownHostsCommand that allows the client to obtaindjm2020-12-221-2/+7
| | | | | | | | | | | known_hosts data from a command in addition to the usual files. The command accepts bunch of %-expansions, including details of the connection and the offered server host key. Note that the command may be invoked up to three times per connection (see the manpage for details). ok markus@
* plumb ssh_conn_info through to sshconnect.c; feedback/ok markus@djm2020-12-201-7/+12
|
* load_hostkeys()/hostkeys_foreach() variants for FILE*djm2020-12-201-5/+6
| | | | | | | | | | | | | | | Add load_hostkeys_file() and hostkeys_foreach_file() that accept a FILE* argument instead of opening the file directly. Original load_hostkeys() and hostkeys_foreach() are implemented using these new interfaces. Add a u_int note field to the hostkey_entry and hostkey_foreach_line structs that is passed directly from the load_hostkeys() and hostkeys_foreach() call. This is a lightweight way to annotate results between different invocations of load_hostkeys(). ok markus@
* scrub keyboard-interactive authentication prompts coming from thedjm2020-11-131-3/+5
| | | | | server through asmprintf() prior to display; suggested by and ok dtucker@
* prefix keyboard interactive prompts with (user@host) to make it easierdjm2020-11-131-7/+12
| | | | | to determine which connection they are associated with in cases like scp -3, ProxyJump, etc. bz#3224 ok dtucker
* when requesting a security key touch on stderr, inform the user oncedjm2020-11-081-2/+2
| | | | the touch has been recorded; requested by claudio@ ok markus@
* print reason in fatal error message when kex_assemble_namelist() failsdjm2020-10-301-4/+4
|
* whitespace; no code changedjm2020-10-291-3/+3
|
* use the new variant log macros instead of prepending __func__ anddjm2020-10-181-117/+101
| | | | appending ssh_err(r) manually; ok markus@
* use do_log2 instead of function pointers to different log functionsdjm2020-10-161-3/+4
|
* revert kex->flags cert hostkey downgrade back to a plain keydjm2020-10-071-7/+2
| | | | | | | (commitid VtF8vozGOF8DMKVg). We now do this a simpler way that needs less plumbing. ok markus@
* when ordering host key algorithms in the client, consider the ECDSAdjm2020-10-041-3/+5
| | | | key subtype; ok markus@
* record when the host key checking code downgrades a certificate hostdjm2020-10-031-2/+7
| | | | | | key to a plain key. This occurs when the user connects to a host with a certificate host key but no corresponding CA key configured in known_hosts; feedback and ok markus@
* tweak the client hostkey preference ordering algorithm to prefer thedjm2020-09-181-3/+38
| | | | | | | default ordering if the user has a key that matches the best-preference default algorithm. feedback and ok markus@
* support for user-verified FIDO keysdjm2020-08-271-13/+24
| | | | | | | | | | | | | | | FIDO2 supports a notion of "user verification" where the user is required to demonstrate their identity to the token before particular operations (e.g. signing). Typically this is done by authenticating themselves using a PIN that has been set on the token. This adds support for generating and using user verified keys where the verification happens via PIN (other options might be added in the future, but none are in common use now). Practically, this adds another key generation option "verify-required" that yields a key that requires a PIN before each authentication. feedback markus@ and Pedro Martelletto; ok markus@
* Replace TAILQ concatenation loops with TAILQ_CONCATbket2020-06-271-9/+3
| | | | OK djm@
* wrap long linedjm2020-06-051-2/+3
|
* when ordering the hostkey algorithms to request from a server,djm2020-05-131-4/+16
| | | | | prefer certificate types if the known_hosts files contain a key marked as a @cert-authority; bz#3157 ok markus@
* fix reversed test that caused IdentitiesOnly=yes to not apply to keysdjm2020-04-171-2/+2
| | | | loaded from a PKCS11Provider; bz3141, ok dtucker@
* When using HostkeyAlgorithms to merely append or remove algorithmsdjm2020-02-061-15/+26
| | | | | | from the default set (i.e. HostkeyAlgorithms=+/-...), retain the default behaviour of preferring those algorithms that have existing keys in known_hosts; ok markus
* Replace "security key" with "authenticator" in program messages.naddy2020-02-061-6/+7
| | | | | | | This replaces "security key" in error/usage/verbose messages and distinguishes between "authenticator" and "authenticator-hosted key". ok djm@
* Make zlib optional. This adds a "ZLIB" build time option that allowsdtucker2020-01-231-3/+3
| | | | | building without zlib compression and associated options. With feedback from markus@, ok djm@
* Replace all calls to signal(2) with a wrapper around sigaction(2).dtucker2020-01-231-4/+4
| | | | | | 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.
* Remove unsupported algorithms from list of defaults at run time anddtucker2020-01-231-4/+4
| | | | | | | | remove ifdef and distinct settings for OPENSSL=no case. This will make things much simpler for -portable where the exact set of algos depends on the configuration of both OpenSSH and the libcrypto it's linked against (if any). ok djm@
* a little more verbosity in sign_and_send_pubkey() debug messagesdjm2020-01-211-3/+5
|
* close the "touch your security key" notifier on the error path toodjm2019-11-151-2/+2
|
* stdarg.h required more broadly; ok djmderaadt2019-11-131-1/+2
|
* security keys typically need to be tapped/touched in order to performdjm2019-11-121-1/+16
| | | | | | | 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-8/+5
|
* Refactor signing - use sshkey_sign for everything, including the newdjm2019-10-311-14/+3
| | | | | | | | | | | 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 client support for U2F/FIDO keysdjm2019-10-311-25/+86
|
* Remove now-redundant perm_ok arg since sshkey_load_private_type willdtucker2019-08-051-3/+3
| | | | | now return SSH_ERR_KEY_BAD_PERMISSIONS in that case. Patch from jitendra.sharma at intel.com, ok djm@
* Remove some set but never used variables. ok daraadt@dtucker2019-07-071-5/+4
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-10/+10
| | | | | | 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.
* fix ssh-keysign fd handling problem introduced in r1.304 caused by a typodjm2019-05-311-2/+2
| | | | (STDIN_FILENO vs STDERR_FILENO)
* When doing the fork+exec'ing for ssh-keysign, rearrange the socketderaadt2019-05-151-7/+9
| | | | | into fd3, so as to not mistakenly leak other fd forward accidentally. ok djm
* fix regression in r1.302 reported by naddy@ - only the first publicdjm2019-02-121-5/+5
| | | | key from the agent was being attempted for use.
* cleanup GSSAPI authentication context after completion of thedjm2019-02-111-67/+88
| | | | | | | | authmethod. Move function-static GSSAPI state to the client Authctxt structure. Make static a bunch of functions that aren't used outside this file. Based on patch from Markus Schmidt <markus@blueflash.cc>; ok markus@
* merge kexkem[cs] into kexgendjm2019-01-211-9/+9
| | | | from markus@ ok djm@
* use KEM API for vanilla ECDHdjm2019-01-211-2/+2
| | | | from markus@ ok djm@
* use KEM API for vanilla DH KEXdjm2019-01-211-6/+6
| | | | from markus@ ok djm@
* use KEM API for vanilla c25519 KEXdjm2019-01-211-2/+2
|