Skip to content

Commit 69ea992

Browse files
committed
Source snapshot from Powershell/openssh-portable:latestw_cwb
1 parent 7c62169 commit 69ea992

File tree

295 files changed

+7149
-16342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+7149
-16342
lines changed

.skipped-commit-ids

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ edbfde98c40007b7752a4ac106095e060c25c1ef Regen moduli
99
180d84674be1344e45a63990d60349988187c1ae Update moduli
1010
f6ae971186ba68d066cd102e57d5b0b2c211a5ee systrace is dead.
1111
96c5054e3e1f170c6276902d5bc65bb3b87a2603 remove DEBUGLIBS from Makefile
12+
6da9a37f74aef9f9cc639004345ad893cad582d8 Update moduli file
13+
77bcb50e47b68c7209c7f0a5a020d73761e5143b unset REGRESS_FAIL_EARLY

CREDITS

-3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,3 @@ Zack Weinberg <[email protected]> - GNOME askpass enhancement
100100
Apologies to anyone I have missed.
101101

102102
Damien Miller <[email protected]>
103-
104-
$Id: CREDITS,v 1.81 2006/08/30 17:24:41 djm Exp $
105-

INSTALL

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
1. Prerequisites
21
----------------
32

3+
A C compiler. Any C89 or better compiler should work. Where supported,
4+
configure will attempt to enable the compiler's run-time integrity checking
5+
options. Some notes about specific compilers:
6+
- clang: -ftrapv and -sanitize=integer require the compiler-rt runtime
7+
(CC=clang LDFLAGS=--rtlib=compiler-rt ./configure)
8+
49
You will need working installations of Zlib and libcrypto (LibreSSL /
510
OpenSSL)
611

7-
Zlib 1.1.4 or 1.2.1.2 or greater (ealier 1.2.x versions have problems):
12+
Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems):
813
http://www.gzip.org/zlib/
914

1015
libcrypto (LibreSSL or OpenSSL >= 0.9.8f < 1.1.0)
@@ -85,7 +90,7 @@ http://nlnetlabs.nl/projects/ldns/
8590
Autoconf:
8691

8792
If you modify configure.ac or configure doesn't exist (eg if you checked
88-
the code out of CVS yourself) then you will need autoconf-2.68 to rebuild
93+
the code out of CVS yourself) then you will need autoconf-2.69 to rebuild
8994
the automatically generated files by running "autoreconf". Earlier
9095
versions may also work but this is not guaranteed.
9196

@@ -224,9 +229,13 @@ review it to ensure that it matches your security requirements.
224229
To generate a host key, run "make host-key". Alternately you can do so
225230
manually using the following commands:
226231

227-
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
228-
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
229-
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
232+
ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N ""
233+
234+
for each of the types you wish to generate (rsa, dsa or ecdsaa) or
235+
236+
ssh-keygen -A
237+
238+
to generate keys for all supported types.
230239

231240
Replacing /etc/ssh with the correct path to the configuration directory.
232241
(${prefix}/etc or whatever you specified with --sysconfdir during
@@ -257,7 +266,4 @@ summary data may be published.
257266

258267
If you experience problems compiling, installing or running OpenSSH.
259268
Please refer to the "reporting bugs" section of the webpage at
260-
http://www.openssh.com/
261-
262-
263-
$Id: INSTALL,v 1.91 2014/09/09 02:23:11 dtucker Exp $
269+
https://www.openssh.com/

Makefile.in

+40-4
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
9797
SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
9898
sshconnect.o sshconnect1.o sshconnect2.o mux.o
9999

100-
SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
100+
SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o \
101101
audit.o audit-bsm.o audit-linux.o platform.o \
102102
sshpty.o sshlogin.o servconf.o serverloop.o \
103-
auth.o auth1.o auth2.o auth-options.o session.o \
104-
auth-chall.o auth2-chall.o groupaccess.o \
103+
auth.o auth2.o auth-options.o session.o \
104+
auth2-chall.o groupaccess.o \
105105
auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \
106106
auth2-none.o auth2-passwd.o auth2-pubkey.o \
107-
monitor_mm.o monitor.o monitor_wrap.o auth-krb5.o \
107+
monitor.o monitor_wrap.o auth-krb5.o \
108108
auth2-gss.o gss-serv.o gss-serv-krb5.o \
109109
loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \
110110
sftp-server.o sftp-common.o \
@@ -240,6 +240,10 @@ clean: regressclean
240240
rm -f regress/unittests/hostkeys/test_hostkeys
241241
rm -f regress/unittests/kex/*.o
242242
rm -f regress/unittests/kex/test_kex
243+
rm -f regress/unittests/match/*.o
244+
rm -f regress/unittests/match/test_match
245+
rm -f regress/unittests/utf8/*.o
246+
rm -f regress/unittests/utf8/test_utf8
243247
rm -f regress/misc/kexfuzz/*.o
244248
rm -f regress/misc/kexfuzz/kexfuzz
245249
(cd openbsd-compat && $(MAKE) clean)
@@ -262,6 +266,10 @@ distclean: regressclean
262266
rm -f regress/unittests/hostkeys/test_hostkeys
263267
rm -f regress/unittests/kex/*.o
264268
rm -f regress/unittests/kex/test_kex
269+
rm -f regress/unittests/match/*.o
270+
rm -f regress/unittests/match/test_match
271+
rm -f regress/unittests/utf8/*.o
272+
rm -f regress/unittests/utf8/test_utf8
265273
rm -f regress/unittests/misc/kexfuzz
266274
(cd openbsd-compat && $(MAKE) distclean)
267275
if test -d pkg ; then \
@@ -422,6 +430,10 @@ regress-prep:
422430
mkdir -p `pwd`/regress/unittests/hostkeys
423431
[ -d `pwd`/regress/unittests/kex ] || \
424432
mkdir -p `pwd`/regress/unittests/kex
433+
[ -d `pwd`/regress/unittests/match ] || \
434+
mkdir -p `pwd`/regress/unittests/match
435+
[ -d `pwd`/regress/unittests/utf8 ] || \
436+
mkdir -p `pwd`/regress/unittests/utf8
425437
[ -d `pwd`/regress/misc/kexfuzz ] || \
426438
mkdir -p `pwd`/regress/misc/kexfuzz
427439
[ -f `pwd`/regress/Makefile ] || \
@@ -512,6 +524,26 @@ regress/unittests/hostkeys/test_hostkeys$(EXEEXT): \
512524
regress/unittests/test_helper/libtest_helper.a \
513525
-lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
514526

527+
UNITTESTS_TEST_MATCH_OBJS=\
528+
regress/unittests/match/tests.o
529+
530+
regress/unittests/match/test_match$(EXEEXT): \
531+
${UNITTESTS_TEST_MATCH_OBJS} \
532+
regress/unittests/test_helper/libtest_helper.a libssh.a
533+
$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_MATCH_OBJS) \
534+
regress/unittests/test_helper/libtest_helper.a \
535+
-lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
536+
537+
UNITTESTS_TEST_UTF8_OBJS=\
538+
regress/unittests/utf8/tests.o
539+
540+
regress/unittests/utf8/test_utf8$(EXEEXT): \
541+
${UNITTESTS_TEST_UTF8_OBJS} \
542+
regress/unittests/test_helper/libtest_helper.a libssh.a
543+
$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_UTF8_OBJS) \
544+
regress/unittests/test_helper/libtest_helper.a \
545+
-lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
546+
515547
MISC_KEX_FUZZ_OBJS=\
516548
regress/misc/kexfuzz/kexfuzz.o
517549

@@ -528,6 +560,8 @@ regress-binaries: regress/modpipe$(EXEEXT) \
528560
regress/unittests/bitmap/test_bitmap$(EXEEXT) \
529561
regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \
530562
regress/unittests/kex/test_kex$(EXEEXT) \
563+
regress/unittests/match/test_match$(EXEEXT) \
564+
regress/unittests/utf8/test_utf8$(EXEEXT) \
531565
regress/misc/kexfuzz/kexfuzz$(EXEEXT)
532566

533567
tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
@@ -546,6 +580,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
546580
TEST_SSH_PUTTYGEN="puttygen"; \
547581
TEST_SSH_CONCH="conch"; \
548582
TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \
583+
TEST_SSH_UTF8="@TEST_SSH_UTF8@" ; \
549584
TEST_SSH_ECC="@TEST_SSH_ECC@" ; \
550585
cd $(srcdir)/regress || exit $$?; \
551586
$(MAKE) \
@@ -570,6 +605,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
570605
TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \
571606
TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \
572607
TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \
608+
TEST_SSH_UTF8="$${TEST_SSH_UTF8}" \
573609
TEST_SSH_ECC="$${TEST_SSH_ECC}" \
574610
TEST_SHELL="${TEST_SHELL}" \
575611
EXEEXT="$(EXEEXT)" \

PROTOCOL

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ protocol.
44
Note that OpenSSH's sftp and sftp-server implement revision 3 of the SSH
55
filexfer protocol described in:
66

7-
http://www.openssh.com/txt/draft-ietf-secsh-filexfer-02.txt
7+
https://www.openssh.com/txt/draft-ietf-secsh-filexfer-02.txt
88

99
Newer versions of the draft will not be supported, though some features
1010
are individually implemented as extensions described below.
@@ -20,7 +20,7 @@ This is a new transport-layer MAC method using the UMAC algorithm
2020
(rfc4418). This method is identical to the "umac-64" method documented
2121
in:
2222

23-
http://www.openssh.com/txt/draft-miller-secsh-umac-01.txt
23+
https://www.openssh.com/txt/draft-miller-secsh-umac-01.txt
2424

2525
1.2. transport: Protocol 2 compression algorithm "[email protected]"
2626

@@ -31,7 +31,7 @@ avoids exposing compression code to attacks from unauthenticated users.
3131

3232
The method is documented in:
3333

34-
http://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt
34+
https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt
3535

3636
1.3. transport: New public key algorithms "[email protected]",
3737

README

+12-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
See http://www.openssh.com/txt/release-7.3p1 for the release notes.
1+
See https://www.openssh.com/releasenotes.html#7.3p1 for the release notes.
22

3-
Please read http://www.openssh.com/report.html for bug reporting
3+
Please read https://www.openssh.com/report.html for bug reporting
44
instructions and note that we do not use Github for bug reporting or
55
patch/pull-request management.
66

7-
- A Japanese translation of this document and of the OpenSSH FAQ is
7+
- A Japanese translation of this document and of the release notes is
88
- available at http://www.unixuser.org/~haruyama/security/openssh/index.html
99
- Thanks to HARUYAMA Seigo <[email protected]>
1010

@@ -16,7 +16,7 @@ implementation with all patent-encumbered algorithms removed (to
1616
external libraries), all known security bugs fixed, new features
1717
reintroduced and many other clean-ups. OpenSSH has been created by
1818
Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt,
19-
and Dug Song. It has a homepage at http://www.openssh.com/
19+
and Dug Song. It has a homepage at https://www.openssh.com/
2020

2121
This port consists of the re-introduction of autoconf support, PAM
2222
support, EGD[1]/PRNGD[2] support and replacements for OpenBSD library
@@ -33,17 +33,15 @@ all logins, not just when using password authentication.
3333
OpenSSH depends on Zlib[3], OpenSSL[4] and optionally PAM[5].
3434

3535
There is now several mailing lists for this port of OpenSSH. Please
36-
refer to http://www.openssh.com/list.html for details on how to join.
36+
refer to https://www.openssh.com/list.html for details on how to join.
3737

3838
Please send bug reports and patches to the mailing list
39-
[email protected]. The list is open to posting by
40-
unsubscribed users.Code contribution are welcomed, but please follow the
41-
OpenBSD style guidelines[6].
39+
[email protected]. The list is open to posting by unsubscribed
40+
users. Code contribution are welcomed, but please follow the OpenBSD
41+
style guidelines[6].
4242

4343
Please refer to the INSTALL document for information on how to install
44-
OpenSSH on your system. There are a number of differences between this
45-
port of OpenSSH and F-Secure SSH 1.x, please refer to the OpenSSH FAQ[7]
46-
for details and general tips.
44+
OpenSSH on your system.
4745

4846
Damien Miller <[email protected]>
4947

@@ -55,15 +53,12 @@ implementation released by Tatu Ylonen.
5553

5654
References -
5755

58-
[0] http://www.openssh.com/faq.html
56+
[0] https://www.openssh.com/
5957
[1] http://www.lothar.com/tech/crypto/
6058
[2] http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html
6159
[3] http://www.gzip.org/zlib/
6260
[4] http://www.openssl.org/
6361
[5] http://www.openpam.org
64-
http://www.kernel.org/pub/linux/libs/pam/
62+
http://www.kernel.org/pub/linux/libs/pam/
6563
(PAM also is standard on Solaris and HP-UX 11)
66-
[6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
67-
[7] http://www.openssh.com/faq.html
68-
69-
$Id: README,v 1.87 2014/08/10 01:35:06 djm Exp $
64+
[6] http://man.openbsd.org/style.9

README.platform

-3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,3 @@ added to sshd's session stack which will prevent users from starting shell
9494
sessions. Alternatively, pam_nologin can be added to either the auth or
9595
account stacks which will prevent authentication entirely, but will still
9696
return the output from pam_nologin to the client.
97-
98-
99-
$Id: README.platform,v 1.10 2009/08/28 23:14:48 dtucker Exp $

README.privsep

-9
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ More information is available at:
88
Privilege separation is now enabled by default; see the
99
UsePrivilegeSeparation option in sshd_config(5).
1010

11-
On systems which lack mmap or anonymous (MAP_ANON) memory mapping,
12-
compression must be disabled in order for privilege separation to
13-
function.
14-
1511
When privsep is enabled, during the pre-authentication phase sshd will
1612
chroot(2) to "/var/empty" and change its privileges to the "sshd" user
1713
and its primary group. sshd is a pseudo-account that should not be
@@ -35,9 +31,6 @@ privsep user and chroot directory:
3531
--with-privsep-path=xxx Path for privilege separation chroot
3632
--with-privsep-user=user Specify non-privileged user for privilege separation
3733

38-
Privsep requires operating system support for file descriptor passing.
39-
Compression will be disabled on systems without a working mmap MAP_ANON.
40-
4134
PAM-enabled OpenSSH is known to function with privsep on AIX, FreeBSD,
4235
HP-UX (including Trusted Mode), Linux, NetBSD and Solaris.
4336

@@ -59,5 +52,3 @@ Given the following process listing (from HP-UX):
5952
process 1005 is the sshd process listening for new connections.
6053
process 6917 is the privileged monitor process, 6919 is the user owned
6154
sshd process and 6921 is the shell process.
62-
63-
$Id: README.privsep,v 1.16 2005/06/04 23:21:41 djm Exp $

TODO

-6
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ Packaging:
6969
7070

7171
PrivSep Issues:
72-
- mmap() issues.
73-
+ /dev/zero solution (Solaris)
74-
+ No/broken MAP_ANON (Irix)
75-
+ broken /dev/zero parse (Linux)
7672
- PAM
7773
+ See above PAM notes
7874
- AIX
@@ -82,5 +78,3 @@ PrivSep Issues:
8278
+ SIA is broken
8379
- Cygwin
8480
+ Privsep for Pre-auth only (no fd passing)
85-
86-
$Id: TODO,v 1.58 2004/12/06 11:40:11 dtucker Exp $

aclocal.m4

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
dnl $Id: aclocal.m4,v 1.13 2014/01/22 10:30:12 djm Exp $
2-
dnl
31
dnl OpenSSH-specific autoconf macros
42
dnl
53

@@ -59,7 +57,8 @@ int main(int argc, char **argv) {
5957
float l = i * 2.1;
6058
double m = l / 0.5;
6159
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
62-
printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
60+
long long int p = n * o;
61+
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
6362
exit(0);
6463
}
6564
]])],
@@ -96,7 +95,8 @@ int main(int argc, char **argv) {
9695
float l = i * 2.1;
9796
double m = l / 0.5;
9897
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
99-
printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
98+
long long p = n * o;
99+
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
100100
exit(0);
101101
}
102102
]])],

addrmatch.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: addrmatch.c,v 1.10 2015/07/08 19:04:21 markus Exp $ */
1+
/* $OpenBSD: addrmatch.c,v 1.13 2016/09/21 16:55:42 djm Exp $ */
22

33
/*
44
* Copyright (c) 2004-2008 Damien Miller <[email protected]>
@@ -398,8 +398,8 @@ addr_match_list(const char *addr, const char *_list)
398398
/* Prefer CIDR address matching */
399399
r = addr_pton_cidr(cp, &match_addr, &masklen);
400400
if (r == -2) {
401-
error("Inconsistent mask length for "
402-
"network \"%.100s\"", cp);
401+
debug2("%s: inconsistent mask length for "
402+
"match network \"%.100s\"", __func__, cp);
403403
ret = -2;
404404
break;
405405
} else if (r == 0) {

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ image: Visual Studio 2015
44
branches:
55
only:
66
- V_7_3w
7+
- latestw_cwb
78

89
init:
910
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

atomicio.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: atomicio.c,v 1.27 2015/01/16 06:40:12 deraadt Exp $ */
1+
/* $OpenBSD: atomicio.c,v 1.28 2016/07/27 23:18:12 djm Exp $ */
22
/*
33
* Copyright (c) 2006 Damien Miller. All rights reserved.
44
* Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -107,12 +107,12 @@ atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
107107
struct iovec iov_array[IOV_MAX], *iov = iov_array;
108108
struct pollfd pfd;
109109

110-
if (iovcnt > IOV_MAX) {
110+
if (iovcnt < 0 || iovcnt > IOV_MAX) {
111111
errno = EINVAL;
112112
return 0;
113113
}
114114
/* Make a copy of the iov array because we may modify it below */
115-
memcpy(iov, _iov, iovcnt * sizeof(*_iov));
115+
memcpy(iov, _iov, (size_t)iovcnt * sizeof(*_iov));
116116

117117
#ifndef BROKEN_READV_COMPARISON
118118
pfd.fd = fd;

audit-bsm.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* $Id: audit-bsm.c,v 1.8 2012/02/23 23:40:43 dtucker Exp $ */
2-
31
/*
42
* TODO
53
*

audit-linux.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* $Id: audit-linux.c,v 1.1 2011/01/17 10:15:30 dtucker Exp $ */
2-
31
/*
42
* Copyright 2010 Red Hat, Inc. All rights reserved.
53
* Use is subject to license terms.

0 commit comments

Comments
 (0)