Skip to content

Commit 94adf70

Browse files
committed
re-merge 9.1
2 parents 27ae664 + 99afa05 commit 94adf70

File tree

151 files changed

+4566
-2453
lines changed

Some content is hidden

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

151 files changed

+4566
-2453
lines changed

.depend

Lines changed: 4 additions & 3 deletions
Large diffs are not rendered by default.

.git_allowed_signers

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[email protected] ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKecyjh9aNmD4rb8WblA8v91JjRb0Cd2JtkzqxcggGeG
2+
[email protected] [email protected] AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBLnJo3ZVDENYZGXm5uO9lU7b0iDFq5gHpTu1MaHPWTEfPdvw+AjFQQ/q5YizuMJkXGsMdYmblJEJZYHpm9IS7ZkAAAAEc3NoOg==
3+
[email protected] [email protected] AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBJoAXBTQalfg+kC5wy1vE7HkIHtVnmV6AUuuIo9KQ1P+70juHwvsFKpsGaqQbrHJkTVgYDGVP02XHj8+Fb18yBIAAAAEc3NoOg==
4+
[email protected] [email protected] AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBH+z1I48s6ydOhP5SJmI02zVCLf0K15B+UMHgoTIKVfUIv5oDoVX7e9f+7QiRmTeEOdZfQydiaVqsfi7qPSve+0AAAAEc3NoOg==
5+
[email protected] [email protected] AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBPM4BmUg/fMnsl42JwktTekk/mB8Be3M+yK2ayg6lqYsqEri8yhRx84gey51OHKVk1TwlGbJjcMHI4URreDBEMQAAAAEc3NoOg==

.git_allowed_signers.asc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-----BEGIN PGP SIGNATURE-----
2+
3+
iQIzBAABCgAdFiEEcWi5g4FaXu9ZpK39Kj9BTnNgYLoFAmMMMiIACgkQKj9BTnNg
4+
YLpyGhAAhZ1RxmD62JnT0gnor1aD0inq1fGPRadaFvXH2OScPcxXMIZWx+otnyZ/
5+
H9s0bIti42dPHqurgh92KS2mDGVIW8Y8MvxFUr678+hdem1U7Xvjoo0uaveNhJhe
6+
GxuQDOvXKRmmfL2c6w3wnFChFA1o3K+JNshjCHhWz7u6+UmY0Q9yIxqbSi+vmEPP
7+
NfWPfGdu4h8r7q11UgTxRSUQkfZXMqpBtb367B9BLduGuKRFKEJNyi6WpjBrqy38
8+
BvEbAaL52KX8hEp3TKMjo38RbOK+veSoPV5zlLui0WlEwwasgljal3f4RkqCAJob
9+
hqpFJRogM5XNnA2e68TDTf3buJ3wRRjuK39/CusOJz5v4i6+VCdte+BET1Y4gD6y
10+
v8KV4pRyumcdbN3khFUkmaQsjo+fyQjWNrgOvv60J2xUWZdchn8lxHOxrfRVKnOi
11+
BD4bdks7tPQY/XsS5GNJIp21Ji9HGyBajjHo0BlesLodw7FEOf6YE18A3n9qzosR
12+
RliuP4Hs/Z4sCUuDTbpKtQiUVs40kBbkhEL8kS8FsXz3VO89hAWaUqNUYom8AkKv
13+
nfDjrZDBLXuVj1Mi8qNPXxqrB/1Cza2/W4U7SK4TlMFXfoXXWxxhefN5vIdMhAJB
14+
u9Mdz1pY9mowKbd0c0dR+3fauvjM133dzKuyeDHMqDa5JPyd59o=
15+
=kgnS
16+
-----END PGP SIGNATURE-----

.github/configs

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
config=$1
1212

13+
unset CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
14+
1315
TEST_TARGET="tests"
1416
LTESTS=""
1517
SKIP_LTESTS=""
@@ -32,19 +34,72 @@ case "$config" in
3234
TEST_TARGET=t-exec
3335
;;
3436
cygwin-release)
35-
CONFIGFLAGS="--with-libedit --with-xauth=/usr/bin/xauth --disable-strip --with-security-key-builtin"
37+
# See https://cygwin.com/git/?p=git/cygwin-packages/openssh.git;a=blob;f=openssh.cygport;hb=HEAD
38+
CONFIGFLAGS="--with-xauth=/usr/bin/xauth --with-security-key-builtin"
39+
CONFIGFLAGS="$CONFIGFLAGS --with-kerberos5=/usr --with-libedit --disable-strip"
3640
;;
3741
clang-12-Werror)
3842
CC="clang-12"
3943
# clang's implicit-fallthrough requires that the code be annotated with
4044
# __attribute__((fallthrough)) and does not understand /* FALLTHROUGH */
41-
CFLAGS="-Wall -Wextra -O2 -Wno-error=implicit-fallthrough"
45+
CFLAGS="-Wall -Wextra -O2 -Wno-error=implicit-fallthrough -Wno-error=unused-parameter"
4246
CONFIGFLAGS="--with-pam --with-Werror"
4347
;;
48+
*-sanitize-*)
49+
case "$config" in
50+
gcc-*)
51+
CC=gcc
52+
;;
53+
clang-*)
54+
# Find the newest available version of clang
55+
for i in `seq 10 99`; do
56+
clang="`which clang-$i 2>/dev/null`"
57+
[ -x "$clang" ] && CC="$clang"
58+
done
59+
;;
60+
esac
61+
# Put Sanitizer logs in regress dir.
62+
SANLOGS=`pwd`/regress
63+
# - We replace chroot with chdir so that the sanitizer in the preauth
64+
# privsep process can read /proc.
65+
# - clang does not recognizes explicit_bzero so we use bzero
66+
# (see https://github.com/google/sanitizers/issues/1507
67+
# - openssl and zlib trip ASAN.
68+
# - sp_pwdp returned by getspnam trips ASAN, hence disabling shadow.
69+
case "$config" in
70+
*-sanitize-address)
71+
CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
72+
LDFLAGS="-fsanitize=address"
73+
CPPFLAGS='-Dchroot=chdir -Dexplicit_bzero=bzero -D_FORTIFY_SOURCE=0 -DASAN_OPTIONS=\"detect_leaks=0:log_path='$SANLOGS'/asan.log\"'
74+
CONFIGFLAGS=""
75+
TEST_TARGET="t-exec"
76+
;;
77+
clang-sanitize-memory)
78+
CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer"
79+
LDFLAGS="-fsanitize=memory"
80+
CPPFLAGS='-Dchroot=chdir -Dexplicit_bzero=bzero -DMSAN_OPTIONS=\"log_path='$SANLOGS'/msan.log\"'
81+
CONFIGFLAGS="--without-openssl --without-zlib --without-shadow"
82+
TEST_TARGET="t-exec"
83+
;;
84+
*-sanitize-undefined)
85+
CFLAGS="-fsanitize=undefined"
86+
LDFLAGS="-fsanitize=undefined"
87+
;;
88+
*)
89+
echo unknown sanitize option;
90+
exit 1;;
91+
esac
92+
features="--disable-security-key --disable-pkcs11"
93+
hardening="--without-sandbox --without-hardening --without-stackprotect"
94+
privsep="--with-privsep-user=root"
95+
CONFIGFLAGS="$CONFIGFLAGS $features $hardening $privsep"
96+
# Because we hobble chroot we can't test it.
97+
SKIP_LTESTS=sftp-chroot
98+
;;
4499
gcc-11-Werror)
45100
CC="gcc"
46101
# -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled
47-
CFLAGS="-Wall -Wextra -Wno-format-truncation -O2 -Wimplicit-fallthrough=4"
102+
CFLAGS="-Wall -Wextra -O2 -Wno-format-truncation -Wimplicit-fallthrough=4 -Wno-unused-parameter"
48103
CONFIGFLAGS="--with-pam --with-Werror"
49104
;;
50105
clang*|gcc*)
@@ -107,14 +162,15 @@ case "$config" in
107162
# Valgrind slows things down enough that the agent timeout test
108163
# won't reliably pass, and the unit tests run longer than allowed
109164
# by github so split into three separate tests.
110-
tests2="rekey integrity try-ciphers sftp"
111-
tests3="krl forward-control sshsig agent-restrict kextype"
165+
tests2="rekey integrity try-ciphers"
166+
tests3="krl forward-control sshsig agent-restrict kextype sftp"
112167
tests4="cert-userkey cert-hostkey kextype sftp-perm keygen-comment percent"
113168
case "$config" in
114169
valgrind-1)
115170
# All tests except agent-timeout (which is flaky under valgrind)
116-
#) and slow ones that run separately to increase parallelism.
117-
SKIP_LTESTS="agent-timeout ${tests2} ${tests3} ${tests4}"
171+
# and hostbased (since valgrind won't let ssh exec keysign).
172+
# Slow ones are run separately to increase parallelism.
173+
SKIP_LTESTS="agent-timeout hostbased ${tests2} ${tests3} ${tests4}"
118174
;;
119175
valgrind-2)
120176
LTESTS="${tests2}"
@@ -145,10 +201,23 @@ case "$config" in
145201
esac
146202

147203
case "${TARGET_HOST}" in
204+
aix*)
205+
# These are slow real or virtual machines so skip the slowest tests
206+
# (which tend to be thw ones that transfer lots of data) so that the
207+
# test run does not time out.
208+
# The agent-restrict test fails due to some quoting issue when run
209+
# with sh or ksh so specify bash for now.
210+
TEST_TARGET="t-exec TEST_SHELL=bash"
211+
SKIP_LTESTS="rekey sftp"
212+
;;
148213
dfly58*|dfly60*)
149214
# scp 3-way connection hangs on these so skip until sorted.
150215
SKIP_LTESTS=scp3
151216
;;
217+
fbsd6)
218+
# Native linker is not great with PIC so OpenSSL is built w/out.
219+
CONFIGFLAGS="${CONFIGFLAGS} --disable-security-key"
220+
;;
152221
hurd)
153222
SKIP_LTESTS="forwarding multiplex proxy-connect hostkey-agent agent-ptrace"
154223
;;
@@ -173,6 +242,10 @@ case "${TARGET_HOST}" in
173242
# SHA256 functions in sha2.h conflict with OpenSSL's breaking sk-dummy
174243
CONFIGFLAGS="${CONFIGFLAGS} --without-hardening --disable-security-key"
175244
;;
245+
openwrt-*)
246+
CONFIGFLAGS="${CONFIGFLAGS} --without-openssl --without-zlib"
247+
TEST_TARGET="t-exec"
248+
;;
176249
sol10|sol11)
177250
# sol10 VM is 32bit and the unit tests are slow.
178251
# sol11 has 4 test configs so skip unit tests to speed up.
@@ -184,10 +257,13 @@ case "${TARGET_HOST}" in
184257
;;
185258
esac
186259

187-
# Unless specified otherwise, build without OpenSSL on Mac OS since
188-
# modern versions don't ship with libcrypto.
189260
case "`./config.guess`" in
261+
*cygwin)
262+
SUDO=""
263+
;;
190264
*-darwin*)
265+
# Unless specified otherwise, build without OpenSSL on Mac OS since
266+
# modern versions don't ship with libcrypto.
191267
LIBCRYPTOFLAGS="--without-openssl"
192268
TEST_TARGET=t-exec
193269
;;
@@ -210,5 +286,5 @@ if [ -x "$(which plink 2>/dev/null)" ]; then
210286
export REGRESS_INTEROP_PUTTY
211287
fi
212288

213-
export CC CFLAGS LTESTS SUDO
289+
export CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
214290
export TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS TEST_SSH_FAIL_FATAL

.github/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ if [ "x$LDFLAGS" != "x" ]; then
1818
fi
1919

2020
echo ./configure ${CONFIGFLAGS}
21-
./configure ${CONFIGFLAGS}
21+
./configure ${CONFIGFLAGS} 2>&1

.github/run_test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
set -ex
88

9+
# If we want to test hostbased auth, set up the host for it.
10+
if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then
11+
sshconf=/usr/local/etc
12+
hostname | $SUDO tee $sshconf/shosts.equiv >/dev/null
13+
echo "EnableSSHKeysign yes" | $SUDO tee $sshconf/ssh_config >/dev/null
14+
$SUDO mkdir -p $sshconf
15+
$SUDO cp -p /etc/ssh/ssh_host*key* $sshconf
16+
$SUDO make install
17+
for key in $sshconf/ssh_host*key*.pub; do
18+
echo `hostname` `cat $key` | \
19+
$SUDO tee -a $sshconf/ssh_known_hosts >/dev/null
20+
done
21+
fi
22+
923
output_failed_logs() {
1024
for i in regress/failed*; do
1125
if [ -f "$i" ]; then

.github/setup_ci.sh

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,73 @@
11
#!/bin/sh
22

3+
PACKAGES=""
4+
35
. .github/configs $@
46

57
case "`./config.guess`" in
8+
*cygwin)
9+
PACKAGER=setup
10+
echo Setting CYGWIN sustem environment variable.
11+
setx CYGWIN "binmode"
12+
chmod -R go-rw /cygdrive/d/a
13+
umask 077
14+
PACKAGES="$PACKAGES,autoconf,automake,cygwin-devel,gcc-core"
15+
PACKAGES="$PACKAGES,make,openssl-devel,zlib-devel"
16+
;;
617
*-darwin*)
18+
PACKAGER=brew
719
brew install automake
820
exit 0
921
;;
22+
*)
23+
PACKAGER=apt
1024
esac
1125

1226
TARGETS=$@
1327

14-
PACKAGES=""
1528
INSTALL_FIDO_PPA="no"
1629
export DEBIAN_FRONTEND=noninteractive
1730

1831
#echo "Setting up for '$TARGETS'"
1932

2033
set -ex
2134

22-
lsb_release -a
35+
if [ -x "`which lsb_release 2>&1`" ]; then
36+
lsb_release -a
37+
fi
38+
39+
# Ubuntu 22.04 defaults to private home dirs which prevent the
40+
# agent-getpeerid test from running ssh-add as nobody. See
41+
# https://github.com/actions/runner-images/issues/6106
42+
if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then
43+
echo ~ is not executable by nobody, adding perms.
44+
chmod go+x ~
45+
fi
2346

2447
if [ "${TARGETS}" = "kitchensink" ]; then
2548
TARGETS="krb5 libedit pam sk selinux"
2649
fi
2750

2851
for flag in $CONFIGFLAGS; do
2952
case "$flag" in
30-
--with-pam) PACKAGES="${PACKAGES} libpam0g-dev" ;;
31-
--with-libedit) PACKAGES="${PACKAGES} libedit-dev" ;;
53+
--with-pam) TARGETS="${TARGETS} pam" ;;
54+
--with-libedit) TARGETS="${TARGETS} libedit" ;;
3255
esac
3356
done
3457

3558
for TARGET in $TARGETS; do
3659
case $TARGET in
37-
default|without-openssl|without-zlib|c89|libedit|*pam)
60+
default|without-openssl|without-zlib|c89)
3861
# nothing to do
3962
;;
63+
clang-sanitize*)
64+
PACKAGES="$PACKAGES clang-12"
65+
;;
66+
cygwin-release)
67+
PACKAGES="$PACKAGES libcrypt-devel libfido2-devel libkrb5-devel"
68+
;;
69+
gcc-sanitize*)
70+
;;
4071
clang-*|gcc-*)
4172
compiler=$(echo $TARGET | sed 's/-Werror//')
4273
PACKAGES="$PACKAGES $compiler"
@@ -47,6 +78,15 @@ for TARGET in $TARGETS; do
4778
heimdal)
4879
PACKAGES="$PACKAGES heimdal-dev"
4980
;;
81+
libedit)
82+
case "$PACKAGER" in
83+
setup) PACKAGES="$PACKAGES libedit-devel" ;;
84+
apt) PACKAGES="$PACKAGES libedit-dev" ;;
85+
esac
86+
;;
87+
*pam)
88+
PACKAGES="$PACKAGES libpam0g-dev"
89+
;;
5090
sk)
5191
INSTALL_FIDO_PPA="yes"
5292
PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev libcbor-dev"
@@ -80,7 +120,7 @@ for TARGET in $TARGETS; do
80120
INSTALL_LIBRESSL=$(echo ${TARGET} | cut -f2 -d-)
81121
case ${INSTALL_LIBRESSL} in
82122
master) ;;
83-
*) INSTALL_LIBRESSL="v$(echo ${TARGET} | cut -f2 -d-)" ;;
123+
*) INSTALL_LIBRESSL="$(echo ${TARGET} | cut -f2 -d-)" ;;
84124
esac
85125
PACKAGES="${PACKAGES} putty-tools"
86126
;;
@@ -99,9 +139,16 @@ if [ "yes" = "$INSTALL_FIDO_PPA" ]; then
99139
sudo apt-add-repository -y ppa:yubico/stable
100140
fi
101141

102-
if [ "x" != "x$PACKAGES" ]; then
103-
sudo apt update -qq
104-
sudo apt install -qy $PACKAGES
142+
if [ "x" != "x$PACKAGES" ]; then
143+
case "$PACKAGER" in
144+
apt)
145+
sudo apt update -qq
146+
sudo apt install -qy $PACKAGES
147+
;;
148+
setup)
149+
/cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`
150+
;;
151+
esac
105152
fi
106153

107154
if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then
@@ -122,11 +169,20 @@ if [ ! -z "${INSTALL_OPENSSL}" ]; then
122169
fi
123170

124171
if [ ! -z "${INSTALL_LIBRESSL}" ]; then
125-
(mkdir -p ${HOME}/libressl && cd ${HOME}/libressl &&
126-
git clone https://github.com/libressl-portable/portable.git &&
127-
cd ${HOME}/libressl/portable &&
128-
git checkout ${INSTALL_LIBRESSL} &&
129-
sh update.sh && sh autogen.sh &&
130-
./configure --prefix=/opt/libressl &&
131-
make -j2 && sudo make install)
172+
if [ "${INSTALL_LIBRESSL}" = "master" ]; then
173+
(mkdir -p ${HOME}/libressl && cd ${HOME}/libressl &&
174+
git clone https://github.com/libressl-portable/portable.git &&
175+
cd ${HOME}/libressl/portable &&
176+
git checkout ${INSTALL_LIBRESSL} &&
177+
sh update.sh && sh autogen.sh &&
178+
./configure --prefix=/opt/libressl &&
179+
make -j2 && sudo make install)
180+
else
181+
LIBRESSL_URLBASE=https://cdn.openbsd.org/pub/OpenBSD/LibreSSL
182+
(cd ${HOME} &&
183+
wget ${LIBRESSL_URLBASE}/libressl-${INSTALL_LIBRESSL}.tar.gz &&
184+
tar xfz libressl-${INSTALL_LIBRESSL}.tar.gz &&
185+
cd libressl-${INSTALL_LIBRESSL} &&
186+
./configure --prefix=/opt/libressl && make -j2 && sudo make install)
187+
fi
132188
fi

0 commit comments

Comments
 (0)