Commit Graph

9865 Commits

Author SHA1 Message Date
djm@openbsd.org
a0876bd994 upstream: print explicit "not modified" message if a file was
requested for resumed download but was considered already complete.

bz#2978 ok dtucker

OpenBSD-Commit-ID: f32084b26a662f16215ee4ca4a403d67e49ab986
2019-07-12 14:07:31 +10:00
tb@openbsd.org
b9b0f2ac96 upstream: Fix a typo and make <esc><right> move right to the
closest end of a word just like <esc><left> moves left to the closest
beginning of a word.

ok djm

OpenBSD-Commit-ID: 6afe01b05ed52d8b12eb1fda6e9af5afb5e198ee
2019-07-12 14:07:31 +10:00
Damien Miller
8729498a5d fix typo that prevented detection of Linux VRF
Reported by hexiaowen AT huawei.com
2019-07-10 09:43:19 +10:00
djm@openbsd.org
5b2b79ff7c upstream: cap the number of permiopen/permitlisten directives we're
willing to parse on a single authorized_keys line; ok deraadt@

OpenBSD-Commit-ID: a43a752c2555d26aa3fc754805a476f6e3e30f46
2019-07-09 14:20:15 +10:00
Darren Tucker
eb0b51dac4 Move log.h include inside ifdefs.
Fixes build on some other platforms that don't have va_list immediately
available (eg NetBSD).
2019-07-08 17:27:26 +10:00
Darren Tucker
43702f8e6f Include log.h for debug() and friends.
Should fix some compiler warnings on IRIX (bz#3032).
2019-07-08 14:27:37 +10:00
Damien Miller
53a6ebf144 sftp-realpath.c needs includes.h 2019-07-08 13:44:32 +10:00
Damien Miller
4efe1adf05 remove realpath() compat replacement
We shipped a BSD implementation of realpath() because sftp-server
depended on its behaviour.

OpenBSD is now moving to a more strictly POSIX-compliant realpath(2),
so sftp-server now unconditionally requires its own BSD-style realpath
implementation. As such, there is no need to carry another independant
implementation in openbsd-compat.

ok dtucker@
2019-07-08 13:38:39 +10:00
dtucker@openbsd.org
696fb4298e upstream: Remove some set but never used variables. ok daraadt@
OpenBSD-Commit-ID: 824baf9c59afc66a4637017e397b9b74a41684e7
2019-07-08 11:45:51 +10:00
deraadt@openbsd.org
156e9e85e9 upstream: still compile uuencode.c, unbreaks build
OpenBSD-Commit-ID: 5ea3d63ab972691f43e9087ab5fd8376d48e898f
2019-07-08 11:45:51 +10:00
djm@openbsd.org
cec9ee527a upstream: revert header removal that snuck into previous
OpenBSD-Commit-ID: 3919cdd58989786660b8269b325646ef8856428e
2019-07-08 11:44:49 +10:00
djm@openbsd.org
569b650f93 upstream: add a local implementation of BSD realpath() for
sftp-server use ahead of OpenBSD's realpath changing to match POSIX;

ok deraadt@ (thanks for snaps testing)

OpenBSD-Commit-ID: 4f8cbf7ed8679f6237264301d104ecec64885d55
2019-07-08 11:44:49 +10:00
Darren Tucker
b8e2b79736 Add prototype for strnlen to prevent warnings. 2019-07-06 13:13:57 +10:00
Darren Tucker
4c3e00b1ed Cast *ID types to unsigned long when printing.
UID and GID types vary by platform so cast to u_long and use %lu when
printing them to prevent warnings.
2019-07-06 13:02:34 +10:00
Darren Tucker
2753521e89 Add prototype for compat strndup.(bz#3032). 2019-07-06 12:54:43 +10:00
Darren Tucker
01a1e21cd5 Add missing bracket in EGD seeding code.
When configured --with-prngd-socket the code had a missing bracket after
an API change.  Fix that and a couple of warnings.  bz#3032 , from
ole.weidner at protonmail.ch
2019-07-06 12:06:48 +10:00
dtucker@openbsd.org
e187b1d460 upstream: Add (recently added) rsa_oldfmt to CLEANFILES.
OpenBSD-Regress-ID: 405beda94e32aa6cc9c80969152fab91f7c54bd3
2019-07-05 15:08:14 +10:00
dtucker@openbsd.org
74b541bfab upstream: Adapt the PuTTY/Conch tests to new key names.
A recent regress change (2a9b3a2ce411d16cda9c79ab713c55f65b0ec257 in
portable) broke the PuTTY and Twisted Conch interop tests, because the
key they want to use is now called ssh-rsa rather than rsa.  Adapt the
tests to the new file names.  bz#3020, patch from cjwatson at debian.org.

OpenBSD-Regress-ID: fd342a37db4d55aa4ec85316f73082c8eb96e64e
2019-07-05 15:07:55 +10:00
dtucker@openbsd.org
de08335a4c upstream: Add a sleep to allow forwards to come up.
Currently when the multiplex client requests a forward it returns
once the request has been sent but not necessarily when the forward
is up.  This causes intermittent text failures due to this race,
so add some sleeps to mitigate this until we can fix it properly.

OpenBSD-Regress-ID: 384c7d209d2443d25ea941d7f677e932621fb253
2019-07-05 15:06:04 +10:00
Darren Tucker
4d24928472 Remove nc stderr redirection to resync w/OpenBSD. 2019-07-05 14:58:57 +10:00
Darren Tucker
c5cfa90e03 Do not fatal on failed lookup of group "tty".
Some platforms (eg AIX and Cygwin) do not have a "tty" group.  In those
cases we will fall back to making the tty device the user's primary
group, so do not fatal if the group lookup fails.  ok djm@
2019-07-05 13:23:46 +10:00
deraadt@openbsd.org
8b4cc4bdc8 upstream: fatal() if getgrnam() cannot find "tty"
OpenBSD-Commit-ID: d148c1c052fa0ed7d105b5428b5c1bab91630048
2019-07-05 11:15:30 +10:00
deraadt@openbsd.org
48cccc275c upstream: stat() returns precisely -1 to indicate error
OpenBSD-Commit-ID: 668e8d022ed4ab847747214f64119e5865365fa1
2019-07-05 11:15:30 +10:00
deraadt@openbsd.org
8142fcaf9e upstream: snprintf/vsnprintf return < 0 on error, rather than -1.
OpenBSD-Commit-ID: a261c421140a0639bb2b66bbceca72bf8239749d
2019-07-05 11:15:30 +10:00
deraadt@openbsd.org
4d28fa78ab upstream: When system calls indicate an error they return -1, not
some arbitrary 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.

OpenBSD-Commit-ID: 48081f00db7518e3b712a49dca06efc2a5428075
2019-07-05 11:10:39 +10:00
deraadt@openbsd.org
e8c974043c upstream: asprintf returns -1, not an arbitrary value < 0. Also
upon error the (very sloppy specification) leaves an undefined value in *ret,
so it is wrong to inspect it, the error condition is enough. discussed a
little with nicm, and then much more with millert until we were exasperated

OpenBSD-Commit-ID: 29258fa51edf8115d244b9d4b84028487bf8923e
2019-07-02 15:59:26 +10:00
deraadt@openbsd.org
1b2d55d15c upstream: oops, from asou
OpenBSD-Commit-ID: 702e765d1639b732370d8f003bb84a1c71c4d0c6
2019-06-28 12:53:02 +10:00
deraadt@openbsd.org
5cdbaa78fc upstream: Some asprintf() calls were checked < 0, rather than the
precise == -1. ok millert nicm tb, etc

OpenBSD-Commit-ID: caecf8f57938685c04f125515b9f2806ad408d53
2019-06-28 11:30:18 +10:00
djm@openbsd.org
b2e3e57be4 upstream: fix NULL deference (bzero) on err
=?UTF-8?q?or=20path=20added=20in=20last=20commit;=20spotted=20by=20Reynir?=
=?UTF-8?q?=20Bj=C3=B6rnsson?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

ok deraadt@ markus@ tb@

OpenBSD-Commit-ID: b11b084bcc551b2c630560eb08618dd501027bbd
2019-06-28 11:30:18 +10:00
Jitendra Sharma
58ceacdcba Update README doc to include missing test cases
Readme regress document is missing various individual tests,
which are supported currently. Update README to
include those test cases.
2019-06-27 20:54:14 +10:00
dtucker@openbsd.org
7959330a55 upstream: Remove unneeded unlink of xauthfile o
=?UTF-8?q?n=20error=20path.=20=20From=20Erik=20Sj=C3=B6lund=20via=20githu?=
=?UTF-8?q?b,=20ok=20djm@=20deraadt@?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

OpenBSD-Commit-ID: 62a4893cf83b29a4bbfedc40e7067c25c203e632
2019-06-27 09:43:39 +10:00
djm@openbsd.org
8de52eb224 upstream: fix mismatch proto/decl from key shielding change; spotted
via oss-fuzz

OpenBSD-Commit-ID: 1ea0ba05ded2c5557507bd844cd446e5c8b5b3b7
2019-06-23 22:22:42 +10:00
djm@openbsd.org
1dfadb9b57 upstream: adapt for key shielding API changes (const removal)
OpenBSD-Regress-ID: 298890bc52f0cd09dba76dc1022fabe89bc0ded6
2019-06-21 14:24:44 +10:00
djm@openbsd.org
4f7a56d5e0 upstream: Add protection for private keys at rest in RAM against
speculation 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@

OpenBSD-Commit-ID: 19767213c312e46f94b303a512ef8e9218a39bd4
2019-06-21 14:24:35 +10:00
djm@openbsd.org
4cd6b12cc9 upstream: print the correct AuthorizedPrincipalsCommand rather than
an uninitialised variable; spotted by dtucker@

OpenBSD-Commit-ID: 02802018784250f68202f01c8561de82e17b0638
2019-06-21 13:21:13 +10:00
jmc@openbsd.org
5f68ab436b upstream: from tim: - for reput, it is remote-path which is
optional, not local-path - sync help

from deraadt:
- prefer -R and undocument -r (but add a comment for future editors)

from schwarze:
- prefer -p and undocument -P (as above. the comment was schwarze's too)

more:
- add the -f flag to reput and reget
- sort help (i can;t remember who suggested this originally)

djm and deraadt were ok with earlier versions of this;
tim and schwarze ok

OpenBSD-Commit-ID: 3c699b53b46111f5c57eed4533f132e7e58bacdd
2019-06-21 13:21:13 +10:00
djm@openbsd.org
99bcbbc77f upstream: check for convtime() refusing to accept times that
resolve to LONG_MAX Reported by Kirk Wolf bz2977; ok dtucker

OpenBSD-Regress-ID: 15c9fe87be1ec241d24707006a31123d3a3117e0
2019-06-19 12:21:40 +10:00
dtucker@openbsd.org
e5cccb2410 upstream: Add unit tests for user@host and URI parsing.
OpenBSD-Regress-ID: 69d5b6f278e04ed32377046f7692c714c2d07a68
2019-06-19 12:21:40 +10:00
dtucker@openbsd.org
0bb7e38834 upstream: Add tests for sshd -T -C with Match.
OpenBSD-Regress-ID: d4c34916fe20d717692f10ef50b5ae5a271c12c7
2019-06-19 12:21:23 +10:00
Darren Tucker
73eb6cef41 Include stdio.h for vsnprintf.
Patch from mforney at mforney.org.
2019-06-16 12:55:27 +10:00
Darren Tucker
adcaf40fd0 upstream rev 1.27: fix integer overflow.
Cast bitcount to u_in64_t before bit shifting to prevent integer overflow
on 32bit platforms which cause incorrect results when adding a block
>=512M in size.  sha1 patch from ante84 at gmail.com via openssh github,
sha2 with djm@, ok tedu@
2019-06-14 14:22:39 +10:00
Darren Tucker
7689048e61 upstream rev 1.25: add DEF_WEAK.
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
ok deraadt@
2019-06-14 14:22:39 +10:00
Darren Tucker
55f3153393 upstream rev 1.25: add sys/types.h 2019-06-14 14:22:39 +10:00
Darren Tucker
10974f986f upstream: Use explicit_bzero instead of memset
in hash Final and End functions.  OK deraadt@ djm@
2019-06-14 14:22:39 +10:00
djm@openbsd.org
cb8f56570f upstream: slightly more instructive error message when the user
specifies multiple -J options on the commandline. bz3015 ok dtucker@

OpenBSD-Commit-ID: 181c15a65cac3b575819bc8d9a56212c3c748179
2019-06-14 14:15:01 +10:00
djm@openbsd.org
2317ce4b0e upstream: process agent requests for RSA certificate private keys using
correct signature algorithm when requested. Patch from Jakub Jelen in bz3016
ok dtucker markus

OpenBSD-Commit-ID: 61f86efbeb4a1857a3e91298c1ccc6cf49b79624
2019-06-14 13:52:48 +10:00
djm@openbsd.org
c95b90d401 upstream: for public key authentication, check AuthorizedKeysFiles
files before consulting AuthorizedKeysCommand; ok dtucker markus

OpenBSD-Commit-ID: 13652998bea5cb93668999c39c3c48e8429db8b3
2019-06-14 13:42:31 +10:00
djm@openbsd.org
a5a5391498 upstream: if passed a bad fd, log what it was
OpenBSD-Commit-ID: 582e2bd05854e49365195b58989b68ac67f09140
2019-06-14 13:42:31 +10:00
jmc@openbsd.org
7349149da1 upstream: Hostname->HostName cleanup; from lauri tirkkonen ok
dtucker

OpenBSD-Commit-ID: 4ade73629ede63b691f36f9a929f943d4e7a44e4
2019-06-14 13:01:28 +10:00
jmc@openbsd.org
76af9c5738 upstream: deraadt noticed some inconsistency in the way we denote
the "Hostname" and "X11UseLocalhost" keywords; this makes things consistent
(effectively reversing my commit of yesterday);

ok deraadt markus djm

OpenBSD-Commit-ID: 255c02adb29186ac91dcf47dfad7adb1b1e54667
2019-06-14 13:01:28 +10:00