Commit Graph

8341 Commits

Author SHA1 Message Date
Darren Tucker 0a45414756 Remove local implementation of err, errx.
We now have a shared implementation in libopenbsd-compat.
2016-07-18 16:27:26 +10:00
djm@openbsd.org eb999a4590 upstream commit
Add some unsigned overflow checks for extra_pad. None of
these are reachable with the amount of padding that we use internally.
bz#2566, pointed out by Torben Hansen. ok markus@

Upstream-ID: 4d4be8450ab2fc1b852d5884339f8e8c31c3fd76
2016-07-18 16:11:46 +10:00
Darren Tucker c71ba790c3 Add dependency on libs for unit tests.
Makes "./configure && make tests" work again.  ok djm@
2016-07-18 15:43:25 +10:00
Darren Tucker 8199d0311a Correct location for kexfuzz in clean target. 2016-07-18 13:47:39 +10:00
Darren Tucker 01558b7b07 Handle PAM_MAXTRIES from modules.
bz#2249: handle the case where PAM returns PAM_MAXTRIES by ceasing to offer
password and keyboard-interative authentication methods.  Should prevent
"sshd ignoring max retries" warnings in the log.  ok djm@

It probably won't trigger with keyboard-interactive in the default
configuration because the retry counter is stored in module-private
storage which goes away with the sshd PAM process (see bz#688).  On the
other hand, those cases probably won't log a warning either.
2016-07-18 09:33:25 +10:00
djm@openbsd.org 65c6c6b567 upstream commit
support UTF-8 characters in ssh(1) banners using
schwarze@'s safe fmprintf printer; bz#2058

feedback schwarze@ ok dtucker@

Upstream-ID: a72ce4e3644c957643c9524eea2959e41b91eea7
2016-07-17 14:21:38 +10:00
jmc@openbsd.org e4eb7d9109 upstream commit
- add proxyjump to the options list - formatting fixes -
update usage()

ok djm

Upstream-ID: 43d318e14ce677a2eec8f21ef5ba2f9f68a59457
2016-07-17 14:21:09 +10:00
dtucker@openbsd.org af1f084857 upstream commit
Reduce the syslog level of some relatively common protocol
events from LOG_CRIT by replacing fatal() calls with logdie().  Part of
bz#2585, ok djm@

Upstream-ID: 9005805227c94edf6ac02a160f0e199638d288e5
2016-07-15 20:54:55 +10:00
Damien Miller bd5f2b78b6 missing openssl/dh.h 2016-07-15 20:02:27 +10:00
Damien Miller 4a984fd342 cast to avoid type warning in error message 2016-07-15 20:02:27 +10:00
Darren Tucker 5abfb15ced Move VA_COPY macro into compat header.
Some AIX compilers unconditionally undefine va_copy but don't set it back
to an internal function, causing link errors.  In some compat code we
already use VA_COPY instead so move the two existing instances into the
shared header and use for sshbuf-getput-basic.c too.  Should fix building
with at lease some versions of AIX's compiler.  bz#2589, ok djm@
2016-07-15 14:54:16 +10:00
Damien Miller 832b7443b7 disable ciphers not supported by OpenSSL
bz#2466 ok dtucker@
2016-07-15 14:45:34 +10:00
Damien Miller 5fbe93fc6f add a --disable-pkcs11 knob 2016-07-15 14:28:59 +10:00
Damien Miller 679ce88ec2 fix newline escaping for unsupported_algorithms
The hmac-ripemd160 was incorrect and could lead to broken
Makefiles on systems that lacked support for it, but I made
all the others consistent too.
2016-07-15 14:28:59 +10:00
djm@openbsd.org ed877ef653 upstream commit
Add a ProxyJump ssh_config(5) option and corresponding -J
ssh(1) command-line flag to allow simplified indirection through a SSH
bastion or "jump host".

These options construct a proxy command that connects to the
specified jump host(s) (more than one may be specified) and uses
port-forwarding to establish a connection to the next destination.

This codifies the safest way of indirecting connections through SSH
servers and makes it easy to use.

ok markus@

Upstream-ID: fa899cb8b26d889da8f142eb9774c1ea36b04397
2016-07-15 14:20:10 +10:00
Darren Tucker 5c02dd1262 Map umac_ctx struct name too.
Prevents size mismatch linker warnings on Solaris 11.
2016-07-15 14:19:24 +10:00
Darren Tucker 283b97ff33 Mitigate timing of disallowed users PAM logins.
When sshd decides to not allow a login (eg PermitRootLogin=no) and
it's using PAM, it sends a fake password to PAM so that the timing for
the failure is not noticeably different whether or not the password
is correct.  This behaviour can be detected by sending a very long
password string which is slower to hash than the fake password.

Mitigate by constructing an invalid password that is the same length
as the one from the client and thus takes the same time to hash.
Diff from djm@
2016-07-15 13:49:44 +10:00
Darren Tucker 9286875a73 Determine appropriate salt for invalid users.
When sshd is processing a non-PAM login for a non-existent user it uses
the string from the fakepw structure as the salt for crypt(3)ing the
password supplied by the client.  That string has a Blowfish prefix, so on
systems that don't understand that crypt will fail fast due to an invalid
salt, and even on those that do it may have significantly different timing
from the hash methods used for real accounts (eg sha512).  This allows
user enumeration by, eg, sending large password strings.  This was noted
by EddieEzra.Harari at verint.com (CVE-2016-6210).

To mitigate, use the same hash algorithm that root uses for hashing
passwords for users that do not exist on the system.  ok djm@
2016-07-15 13:45:42 +10:00
Darren Tucker a162dd5e58 OpenSSL 1.1.x not currently supported. 2016-07-14 21:19:59 +10:00
Darren Tucker 7df91b01fc Check for VIS_ALL.
If we don't have it, set BROKEN_STRNVIS to activate the compat replacement.
2016-07-14 12:26:54 +10:00
dtucker@openbsd.org ee67716f61 upstream commit
Correct equal in test.

Upstream-Regress-ID: 4e32f7a5c57a619c4e8766cb193be2a1327ec37a
2016-07-14 11:39:34 +10:00
tb@openbsd.org 372807c206 upstream commit
Add missing "recvfd" pledge promise: Raf Czlonka reported
ssh coredumps when Control* keywords were set in ssh_config. This patch also
fixes similar problems with scp and sftp.

ok deraadt, looks good to millert

Upstream-ID: ca2099eade1ef3e87a79614fefa26a0297ad8a3b
2016-07-14 11:27:56 +10:00
tedu@openbsd.org e0453f3df6 upstream commit
obsolete note about fascistloggin is obsolete. ok djm
dtucker

Upstream-ID: dae60df23b2bb0e89f42661ddd96a7b0d1b7215a
2016-07-14 11:27:56 +10:00
Darren Tucker a233358417 Add compat code for missing wcwidth.
If we don't have wcwidth force fallback implementations of nl_langinfo
and mbtowc.  Based on advice from Ingo Schwarze.
2016-07-14 10:59:09 +10:00
Damien Miller 8aaec70506 fix missing include for systems with err.h 2016-07-14 09:48:48 +10:00
Darren Tucker 6310ef27a2 Move err.h replacements into compat lib.
Move implementations of err.h replacement functions into their own file
in the libopenbsd-compat so we can use them in kexfuzz.c too.  ok djm@
2016-07-13 14:42:35 +10:00
Darren Tucker f3f2cc8386 Check for wchar.h and langinfo.h
Wrap includes in the appropriate #ifdefs.
2016-07-11 17:26:49 +10:00
Damien Miller b9c50614eb whitelist more architectures for seccomp-bpf
bz#2590 - testing and patch from Jakub Jelen
2016-07-08 13:59:13 +10:00
guenther@openbsd.org 18813a32b6 upstream commit
DEBUGLIBS has been broken since the gcc4 switch, so delete
it.  CFLAGS contains -g by default anyway

problem noted by Edgar Pettijohn (edgar (at) pettijohn-web.com)
ok millert@ kettenis@ deraadt@

Upstream-Regress-ID: 4a0bb72f95c63f2ae9daa8a040ac23914bddb542
2016-07-08 13:51:12 +10:00
djm@openbsd.org 6d31193d0b upstream commit
Improve crypto ordering for Encrypt-then-MAC (EtM) mode
MAC algorithms.

Previously we were computing the MAC, decrypting the packet and then
checking the MAC. This gave rise to the possibility of creating a
side-channel oracle in the decryption step, though no such oracle has
been identified.

This adds a mac_check() function that computes and checks the MAC in
one pass, and uses it to advance MAC checking for EtM algorithms to
before payload decryption.

Reported by Jean Paul Degabriele, Kenny Paterson, Torben Hansen and
Martin Albrecht. feedback and ok markus@

Upstream-ID: 1999bb67cab47dda5b10b80d8155fe83d4a1867b
2016-07-08 13:50:03 +10:00
guenther@openbsd.org 71f5598f06 upstream commit
DEBUGLIBS has been broken since the gcc4 switch, so
delete it.  CFLAGS contains -g by default anyway

problem noted by Edgar Pettijohn (edgar (at) pettijohn-web.com)
ok millert@ kettenis@ deraadt@

Upstream-ID: 96c5054e3e1f170c6276902d5bc65bb3b87a2603
2016-07-08 13:50:03 +10:00
dtucker@openbsd.org e683fc6f1c upstream commit
Explicitly check for 100% completion to avoid potential
floating point rounding error, which could cause progressmeter to report 99%
on completion. While there invert the test so the 100% case is clearer.  with
& ok djm@

Upstream-ID: a166870c5878e422f3c71ff802e2ccd7032f715d
2016-07-08 13:46:59 +10:00
jmc@openbsd.org 772e6cec0e upstream commit
sort the -o list;

Upstream-ID: 1a97465ede8790b4d47cb618269978e07f41f8ac
2016-07-08 13:46:59 +10:00
djm@openbsd.org 46ecd19e55 upstream commit
fix AuthenticationMethods during configuration re-parse;
reported by Juan Francisco Cantero Hurtado

Upstream-ID: 8ffa1dac25c7577eca8238e825317ab20848f9b4
2016-06-24 13:35:28 +10:00
djm@openbsd.org 3147e7595d upstream commit
revert 1.34; causes problems loading public keys

reported by semarie@

Upstream-ID: b393794f8935c8b15d98a407fe7721c62d2ed179
2016-06-24 13:35:28 +10:00
jmc@openbsd.org ad23a75509 upstream commit
grammar fix;

Upstream-ID: 5d5b21c80f1e81db367333ce0bb3e5874fb3e463
2016-06-24 13:35:28 +10:00
djm@openbsd.org 5e28b1a2a3 upstream commit
translate OpenSSL error codes to something more
meaninful; bz#2522 reported by Jakub Jelen, ok dtucker@

Upstream-ID: 4cb0795a366381724314e6515d57790c5930ffe5
2016-06-24 13:35:28 +10:00
djm@openbsd.org b64faeb5ed upstream commit
ban AuthenticationMethods="" and accept
AuthenticationMethods=any for the default behaviour of not requiring multiple
authentication

bz#2398 from Jakub Jelen; ok dtucker@

Upstream-ID: fabd7f44d59e4518d241d0d01e226435cc23cf27
2016-06-24 13:35:28 +10:00
dtucker@openbsd.org 9816fc5dae upstream commit
Include stdarg.h for va_copy as per man page.

Upstream-ID: 105d6b2f1af2fbd9d91c893c436ab121434470bd
2016-06-24 13:35:28 +10:00
jmc@openbsd.org b6cf84b51b upstream commit
keys stored in openssh format can have comments too; diff
from yonas yanfa, tweaked a bit;

ok djm

Upstream-ID: 03d48536da6e51510d73ade6fcd44ace731ceb27
2016-06-24 13:35:28 +10:00
Darren Tucker aa37768f17 get_remote_name_or_ip inside LOGIN_NEEDS_UTMPX
Apply the same get_remote_name_or_ip -> session_get_remote_name_or_ip
change as commit 95767262 to the code inside #ifdef LOGIN_NEEDS_UTMPX.
Fixes build on AIX.
2016-06-20 15:55:34 +10:00
Darren Tucker 009891afc8 Remove duplicate code from PAM. ok djm@ 2016-06-17 14:34:09 +10:00
dtucker@openbsd.org e690fe8575 upstream commit
Remove "POSSIBLE BREAK-IN ATTEMPT!" from log message
about forward and reverse DNS not matching.  We haven't supported IP-based
auth methods for a very long time so it's now misleading.  part of bz#2585,
ok markus@

Upstream-ID: 5565ef0ee0599b27f0bd1d3bb1f8a323d8274e29
2016-06-15 12:06:33 +10:00
Darren Tucker 57b4ee04ca Move platform_disable_tracing into its own file.
Prevents link errors resolving the extern "options" when platform.o
gets linked into ssh-agent when building --with-pam.
2016-06-15 11:29:24 +10:00
Darren Tucker 78dc8e3724 Track skipped upstream commit IDs.
There are a small number of "upstream" commits that do not correspond to
a file in -portable.  This file tracks those so that we can reconcile
OpenBSD and Portable to ensure that no commits are accidentally missed.

If you add something to .skipped-commit-ids please also add an upstream
ID line in the following format when you commit it.

    Upstream-ID: 321065a95a7ccebdd5fd08482a1e19afbf524e35
    Upstream-ID: d4f699a421504df35254cf1c6f1a7c304fb907ca
    Upstream-ID: aafe246655b53b52bc32c8a24002bc262f4230f7
    Upstream-ID: 8fa9cd1dee3c3339ae329cf20fb591db6d605120
    Upstream-ID: f31327a48dd4103333cc53315ec53fe65ed8a17a
    Upstream-ID: edbfde98c40007b7752a4ac106095e060c25c1ef
    Upstream-ID: 052fd565e3ff2d8cec3bc957d1788f50c827f8e2
    Upstream-ID: 7cf73737f357492776223da1c09179fa6ba74660
    Upstream-ID: 180d84674be1344e45a63990d60349988187c1ae
    Upstream-ID: f6ae971186ba68d066cd102e57d5b0b2c211a5ee
2016-06-14 13:55:12 +10:00
Darren Tucker 9f919d1a32 Remove now-defunct .cvsignore files. ok djm 2016-06-14 13:51:01 +10:00
dtucker@openbsd.org 68777faf27 upstream commit
Back out rev 1.28 "Check min and max sizes sent by the
client" change. It caused "key_verify failed for server_host_key" in clients
that send a DH-GEX min value less that DH_GRP_MIN, eg old OpenSSH and PuTTY.
ok djm@

Upstream-ID: 452979d3ca5c1e9dff063287ea0a5314dd091f65
2016-06-14 13:43:59 +10:00
Darren Tucker a86ec4d073 Use Solaris setpflags(__PROC_PROTECT, ...).
Where possible, use Solaris setpflags to disable process tracing on
ssh-agent and sftp-server.  bz#2584, based on a patch from huieying.lee
at oracle.com, ok djm.
2016-06-14 10:48:27 +10:00
Darren Tucker 0f916d39b0 Shorten prctl code a tiny bit. 2016-06-14 10:43:53 +10:00
Darren Tucker 0fb7f59853 Move prctl PR_SET_DUMPABLE into platform.c.
This should make it easier to add additional platform support such as
Solaris (bz#2584).
2016-06-09 16:23:07 +10:00