summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* make ssh->kex->session_id a sshbuf instead of u_char*/size_t anddjm2021-01-2715-103/+80
| | | | | 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-2714-73/+70
| | | | purpose-built ssh->compat variable instead; feedback/ok markus@
* Logical not bitwise or. ok djm@dtucker2021-01-271-2/+2
|
* move HostbasedAcceptedAlgorithms to the right place in alphabetical ordernaddy2021-01-264-15/+15
|
* Remove unused variables leftover from refactoring. ok djm@dtucker2021-01-261-6/+4
|
* Rename HostbasedKeyTypes (ssh) and HostbasedAcceptedKeyTypes (sshd) todtucker2021-01-2613-50/+55
| | | | | | HostbasedAcceptedAlgorithms, which more accurately reflects its effect. This matches a previous change to PubkeyAcceptedAlgorithms. The previous names are retained as aliases. ok djm@
* refactor key constraint parsing in ssh-agentdjm2021-01-261-69/+95
| | | | | | | | | | Key constraints parsing code previously existed in both the "add regular key" and "add smartcard key" path. This unifies them but also introduces more consistency checking: duplicated constraints and constraints that are nonsensical for a particular situation (e.g. FIDO provider for a smartcard key) are now banned. ok markus@
* more ssh-agent refactoringdjm2021-01-261-67/+130
| | | | | | | | | | Allow confirm_key() to accept an additional reason suffix Factor publickey userauth parsing out into its own function and allow it to optionally return things it parsed out of the message to its caller. feedback/ok markus@
* make struct hostkeys public; I have no idea why I made it opaquedjm2021-01-262-8/+6
| | | | | | originally. ok markus@
* move check_host_cert() from sshconnect,c to sshkey.c and refactordjm2021-01-267-51/+69
| | | | | | it to make it more generally usable and testable. ok markus@
* use recallocarray to allocate the agent sockets table; also cleardjm2021-01-261-4/+16
| | | | | | | | | socket entries that are being marked as unused. spinkle in some debug2() spam to make it easier to watch an agent do its thing. ok markus
* factor out common code in the agent clientdjm2021-01-261-24/+39
| | | | | | | | Add a ssh_request_reply_decode() function that sends a message to the agent, reads and parses a success/failure reply. Use it for all requests that only expect success/failure ok markus@
* 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@
* PubkeyAcceptedKeyTypes->PubkeyAcceptedAlgorithms here too.dtucker2021-01-221-3/+3
|
* Rename PubkeyAcceptedKeyTypes keyword to PubkeyAcceptedAlgorithms.dtucker2021-01-2212-73/+76
| | | | | | | | 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@
* Make output buffer larger to prevent potential truncation warnings fromdtucker2021-01-151-2/+2
| | | | | compilers not smart enough to know the strftime calls won't ever fully fill "to" and "from". ok djm@
* Change types in convtime() unit test to int to match change its new type.dtucker2021-01-151-3/+3
| | | | | Add tests for boundary conditions and fix convtime to work up to INT_MAX. ok djm@
* In waitfd(), when poll returns early we are subtracting the elapsed timedtucker2021-01-151-2/+2
| | | | | | from the timeout each loop, so we only want to measure the elapsed time the poll() in that loop, not since the start of the function. Spotted by chris.xj.zhu at gmail.com, ok djm@
* Minor grammatical correction.rob2021-01-142-6/+6
| | | | OK jmc@
* Correct spelling of persourcenetblocksize in config-dump mode.dtucker2021-01-111-2/+2
|
* Change convtime() from returning long to returning int. On platformsdtucker2021-01-114-14/+14
| | | | | | where sizeof(int) != sizeof(long), convtime could accept values >MAX_INT which subsequently truncate when stored in an int during config parsing. bz#3250, ok djm@
* add a comma to previous;jmc2021-01-091-2/+2
|
* Add PerSourceMaxStartups and PerSourceNetBlockSize options which providedtucker2021-01-097-12/+255
| | | | | more fine grained MaxStartups limits. Man page help jmc@, feedback & ok djm@
* Move address handling functions out into their own file in order to reusedtucker2021-01-094-328/+483
| | | | | | them for per-source maxstartups limiting. Supplement with some additional functions from djm's flowtools that we'll also need. ok djm@ (as part of a larger diff).
* make CheckHostIP default to 'no'. It doesn't provide any perceptibledjm2021-01-082-6/+6
| | | | | | | value and makes it much harder for hosts to change host keys, particularly ones that use IP-based load-balancing. ok dtucker@
* 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@
* don't try to use timespeccmp(3) directly as a qsort(3) comparisondjm2021-01-081-4/+7
| | | | | | | | function - it returns 0/1 and not the -1/0/1 that qsort expectes. fixes sftp "ls -ltr" under some circumstances. Based on patch by Masahiro Matsuya via bz3248.
* Update the sntrup761 creation script and generated code:dtucker2021-01-083-121/+49
| | | | | | | | | | - remove unneeded header files and typedefs and rely on crypto_api.h - add defines to map types used to the crypto_api ones instead of typedefs. This prevents typedef name collisions in -portable. - remove CRYPTO_NAMESPACE entirely instead of making it a no-op - delete unused functions and make the remaining ones that aren't exported static. ok djm@
* mention that DisableForwarding is valid in a sshd_config Match blockdjm2021-01-081-2/+3
| | | | reported by Fredrik Eriksson in bz3239
* estructure sntrup761.sh to process all files in a single list, which willdtucker2021-01-043-41/+33
| | | | make it easier to reorder. Re-inline int32_MINMAX. ok tobhe@
* Prevent redefinition of `crypto_int32' error with gcc3.tobhe2021-01-032-4/+4
| | | | | | | Fixes compilation on luna88k. Feedback millert@ Found by and ok aoyama@
* Use int64_t for intermediate values in int32_MINMAX to prevent signedtobhe2020-12-303-15/+24
| | | | | | | 32-bit integer overflow. Found by and ok djm@ ok markus@
* Update/replace the experimental post-quantim hybrid key exchangedjm2020-12-2916-1207/+1496
| | | | | | | | | | | | | | | | | | 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)
* tweak the description of KnownHostsCommand in ssh_conf.5, and addjmc2020-12-223-14/+16
| | | | | | entries for it to the -O list in scp.1 and sftp.1; ok djm
* Remove lines accidentally left behind in the ProxyJump parsing fix r1.345.tb2020-12-221-4/+1
| | | | ok djm
* add a ssh_config KnownHostsCommand that allows the client to obtaindjm2020-12-227-16/+188
| | | | | | | | | | | 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@
* move subprocess() from auth.c to misc.cdjm2020-12-225-167/+190
| | | | | | | | | | make privilege dropping optional but allow it via callbacks (to avoid need to link uidswap.c everywhere) add some other flags (keep environment, disable strict path safety check) that make this more useful for client-side use. feedback & ok markus@
* Remove the pre-standardization cipher rijndael-cbc@lysator.liu.se.dtucker2020-12-211-3/+1
| | | | | | | | | It is an alias for aes256-cbc which was standardized in RFC4253 (2006), has been deprecated and disabled by default since OpenSSH 7.2 (2016) and was only briefly documented in ssh.1 in 2001. This will reduce the amount of work the cipher/kex regression tests need to do by a little bit. ok markus@ djm@
* properly fix ProxyJump parsing; Thanks to tb@ for pointing out my errordjm2020-12-211-4/+9
| | | | | | | (parse_ssh_uri() can return -1/0/1, that I missed). Reported by Raf Czlonka via bugs@ ok tb@
* plumb ssh_conn_info through to sshconnect.c; feedback/ok markus@djm2020-12-204-53/+57
|
* allow UserKnownHostsFile=none; feedback and ok markus@djm2020-12-202-13/+35
|
* load_hostkeys()/hostkeys_foreach() variants for FILE*djm2020-12-207-34/+76
| | | | | | | | | | | | | | | 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@
* Print client kem key with correct length.tobhe2020-12-191-2/+2
| | | | ok markus@
* fix possible error("%s", NULL) on error pathsdjm2020-12-171-3/+3
|
* refactor client percent_expand() argument passing; consolidate thedjm2020-12-172-66/+95
| | | | | common arguments into a single struct and pass that around instead of using a bunch of globals. ok markus@
* prepare readconf.c for fuzzing; remove fatal calls and fix somedjm2020-12-174-161/+412
| | | | (one-off) memory leaks; ok markus@
* use _PATH_SSH_USER_DIR instead of hardcoded .ssh in pathdjm2020-12-141-3/+3
|
* shuffle a few utility functions into sftp-client.c; from Jakub Jelendjm2020-12-043-55/+69
|
* make ssh_free(NULL) a no-opdjm2020-12-041-1/+4
|
* memleak of DH public bignum; found with libfuzzerdjm2020-12-041-1/+2
|