2019-09-03 10:37:45 +02:00
|
|
|
# $OpenBSD: Makefile,v 1.104 2019/09/03 08:37:45 djm Exp $
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2019-07-24 06:21:19 +02:00
|
|
|
tests: prep file-tests t-exec unit
|
|
|
|
|
|
|
|
REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
|
|
|
|
|
|
|
|
# File based tests
|
|
|
|
file-tests: $(REGRESS_TARGETS)
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2008-03-12 14:17:00 +01:00
|
|
|
# Interop tests are not run by default
|
2008-03-13 02:05:40 +01:00
|
|
|
interop interop-tests: t-exec-interop
|
2008-03-12 14:17:00 +01:00
|
|
|
|
2015-02-27 05:32:58 +01:00
|
|
|
prep:
|
2015-02-28 17:05:27 +01:00
|
|
|
test "x${USE_VALGRIND}" = "x" || mkdir -p $(OBJ)/valgrind-out
|
2015-02-27 05:32:58 +01:00
|
|
|
|
2003-09-04 07:37:58 +02:00
|
|
|
clean:
|
2003-09-14 03:40:35 +02:00
|
|
|
for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done
|
2008-03-27 07:42:06 +01:00
|
|
|
rm -rf $(OBJ).putty
|
|
|
|
|
2003-09-04 07:37:58 +02:00
|
|
|
distclean: clean
|
2002-05-01 05:17:33 +02:00
|
|
|
|
|
|
|
LTESTS= connect \
|
|
|
|
proxy-connect \
|
|
|
|
connect-privsep \
|
2017-10-24 21:33:32 +02:00
|
|
|
connect-uri \
|
2002-05-01 05:17:33 +02:00
|
|
|
proto-version \
|
|
|
|
proto-mismatch \
|
|
|
|
exit-status \
|
2004-06-16 12:08:56 +02:00
|
|
|
envpass \
|
2002-05-01 05:17:33 +02:00
|
|
|
transfer \
|
2003-10-08 09:47:19 +02:00
|
|
|
banner \
|
2003-06-18 14:32:51 +02:00
|
|
|
rekey \
|
2019-09-27 07:26:22 +02:00
|
|
|
dhgex \
|
2002-05-01 05:17:33 +02:00
|
|
|
stderr-data \
|
|
|
|
stderr-after-eof \
|
|
|
|
broken-pipe \
|
|
|
|
try-ciphers \
|
|
|
|
yes-head \
|
2004-02-29 10:30:17 +01:00
|
|
|
login-timeout \
|
2002-05-01 05:17:33 +02:00
|
|
|
agent \
|
2003-01-22 07:53:16 +01:00
|
|
|
agent-getpeereid \
|
|
|
|
agent-timeout \
|
|
|
|
agent-ptrace \
|
2002-05-01 05:17:33 +02:00
|
|
|
keyscan \
|
2003-01-22 07:53:16 +01:00
|
|
|
keygen-change \
|
2010-02-24 07:24:56 +01:00
|
|
|
keygen-convert \
|
2016-09-12 04:25:46 +02:00
|
|
|
keygen-moduli \
|
2008-06-30 00:06:25 +02:00
|
|
|
key-options \
|
2004-06-16 12:15:59 +02:00
|
|
|
scp \
|
2017-10-24 21:33:32 +02:00
|
|
|
scp-uri \
|
2002-05-01 05:17:33 +02:00
|
|
|
sftp \
|
2013-05-17 01:35:26 +02:00
|
|
|
sftp-chroot \
|
2003-01-22 07:53:16 +01:00
|
|
|
sftp-cmds \
|
2003-06-18 14:35:11 +02:00
|
|
|
sftp-badcmds \
|
2003-01-22 07:53:16 +01:00
|
|
|
sftp-batch \
|
2005-03-07 07:36:18 +01:00
|
|
|
sftp-glob \
|
2013-10-18 00:05:41 +02:00
|
|
|
sftp-perm \
|
2017-10-24 21:33:32 +02:00
|
|
|
sftp-uri \
|
2003-06-18 14:45:34 +02:00
|
|
|
reconfigure \
|
2003-07-03 12:27:55 +02:00
|
|
|
dynamic-forward \
|
2004-06-16 12:22:22 +02:00
|
|
|
forwarding \
|
2004-06-25 05:45:18 +02:00
|
|
|
multiplex \
|
2004-12-06 13:07:37 +01:00
|
|
|
reexec \
|
2006-07-24 07:31:41 +02:00
|
|
|
brokenkeys \
|
2016-06-03 06:10:41 +02:00
|
|
|
sshcfgparse \
|
2015-04-23 07:01:19 +02:00
|
|
|
cfgparse \
|
2006-07-24 07:31:41 +02:00
|
|
|
cfgmatch \
|
2018-06-07 06:46:34 +02:00
|
|
|
cfgmatchlisten \
|
2008-06-10 15:16:46 +02:00
|
|
|
addrmatch \
|
2008-03-12 13:58:05 +01:00
|
|
|
localcommand \
|
2009-10-07 01:31:56 +02:00
|
|
|
forcecommand \
|
2010-02-26 21:57:12 +01:00
|
|
|
portnum \
|
2010-11-05 08:23:38 +01:00
|
|
|
keytype \
|
|
|
|
kextype \
|
2010-02-26 21:57:12 +01:00
|
|
|
cert-hostkey \
|
2011-01-06 23:54:20 +01:00
|
|
|
cert-userkey \
|
2012-12-03 00:12:13 +01:00
|
|
|
host-expand \
|
2012-12-03 00:13:39 +01:00
|
|
|
keys-command \
|
2012-12-12 00:54:37 +01:00
|
|
|
forward-control \
|
2013-01-18 01:51:56 +01:00
|
|
|
integrity \
|
2014-12-22 09:06:03 +01:00
|
|
|
krl \
|
2015-01-13 08:49:49 +01:00
|
|
|
multipubkey \
|
2015-01-18 20:47:55 +01:00
|
|
|
limit-keytype \
|
2015-01-18 23:00:18 +01:00
|
|
|
hostkey-agent \
|
2015-01-26 07:12:18 +01:00
|
|
|
keygen-knownhosts \
|
2015-05-21 08:44:25 +02:00
|
|
|
hostkey-rotate \
|
2015-09-24 08:16:53 +02:00
|
|
|
principals-command \
|
2016-04-15 02:31:10 +02:00
|
|
|
cert-file \
|
2016-12-16 04:51:19 +01:00
|
|
|
cfginclude \
|
2017-06-24 08:35:24 +02:00
|
|
|
allow-deny-users \
|
2019-09-03 10:37:45 +02:00
|
|
|
authinfo \
|
|
|
|
sshsig
|
2015-01-13 08:49:49 +01:00
|
|
|
|
|
|
|
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2008-06-30 00:07:56 +02:00
|
|
|
INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers
|
2008-03-12 14:17:00 +01:00
|
|
|
#INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp
|
|
|
|
|
2019-01-21 00:24:19 +01:00
|
|
|
EXTRA_TESTS= agent-pkcs11
|
|
|
|
#EXTRA_TESTS+= cipher-speed
|
2010-11-05 08:23:38 +01:00
|
|
|
|
2017-05-09 06:35:03 +02:00
|
|
|
USERNAME= ${LOGNAME}
|
2016-10-06 11:31:38 +02:00
|
|
|
CLEANFILES= *.core actual agent-key.* authorized_keys_${USERNAME} \
|
|
|
|
authorized_keys_${USERNAME}.* \
|
|
|
|
authorized_principals_${USERNAME} \
|
2016-04-15 02:48:01 +02:00
|
|
|
banner.in banner.out cert_host_key* cert_user_key* \
|
|
|
|
copy.1 copy.2 data ed25519-agent ed25519-agent* \
|
2017-05-09 06:35:03 +02:00
|
|
|
ed25519-agent.pub ed25519 ed25519.pub empty.in \
|
|
|
|
expect failed-regress.log failed-ssh.log failed-sshd.log \
|
2019-07-16 04:09:29 +02:00
|
|
|
hkr.* host.ecdsa-sha2-nistp256 host.ecdsa-sha2-nistp384 \
|
|
|
|
host.ecdsa-sha2-nistp521 host.ssh-dss host.ssh-ed25519 \
|
|
|
|
host.ssh-rsa host_ca_key* host_krl_* host_revoked_* key.* \
|
2017-05-09 06:35:03 +02:00
|
|
|
key.dsa-* key.ecdsa-* key.ed25519-512 \
|
|
|
|
key.ed25519-512.pub key.rsa-* keys-command-args kh.* \
|
|
|
|
known_hosts known_hosts-cert known_hosts.* krl-* ls.copy \
|
|
|
|
modpipe netcat no_identity_config \
|
2019-07-16 05:21:54 +02:00
|
|
|
pidfile putty.rsa2 ready regress.log remote_pid \
|
|
|
|
revoked-* rsa rsa-agent rsa-agent.pub rsa.pub rsa_ssh2_cr.prv \
|
2016-04-15 02:48:01 +02:00
|
|
|
rsa_ssh2_crnl.prv scp-ssh-wrapper.exe \
|
|
|
|
scp-ssh-wrapper.scp setuid-allowed sftp-server.log \
|
|
|
|
sftp-server.sh sftp.log ssh-log-wrapper.sh ssh.log \
|
2019-07-05 06:19:39 +02:00
|
|
|
ssh-rsa_oldfmt \
|
2016-04-15 02:48:01 +02:00
|
|
|
ssh_config ssh_config.* ssh_proxy ssh_proxy_bak \
|
2017-05-09 06:35:03 +02:00
|
|
|
ssh_proxy_envpass sshd.log sshd_config sshd_config_minimal \
|
|
|
|
sshd_config.orig sshd_proxy sshd_proxy.* sshd_proxy_bak \
|
|
|
|
sshd_proxy_orig t10.out t10.out.pub t12.out t12.out.pub \
|
|
|
|
t2.out t3.out t6.out1 t6.out2 t7.out t7.out.pub \
|
|
|
|
t8.out t8.out.pub t9.out t9.out.pub testdata \
|
|
|
|
user_*key* user_ca* user_key*
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2010-02-24 07:28:45 +01:00
|
|
|
# Enable all malloc(3) randomisations and checks
|
2016-11-01 14:43:27 +01:00
|
|
|
TEST_ENV= "MALLOC_OPTIONS=CFGJRSUX"
|
2010-02-24 07:28:45 +01:00
|
|
|
|
2011-01-17 00:51:40 +01:00
|
|
|
TEST_SSH_SSHKEYGEN?=ssh-keygen
|
|
|
|
|
2013-02-19 03:15:01 +01:00
|
|
|
CPPFLAGS=-I..
|
|
|
|
|
2002-05-01 05:17:33 +02:00
|
|
|
t1:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
|
2010-11-05 08:23:38 +01:00
|
|
|
tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -if ${.OBJDIR}/rsa_ssh2_cr.prv | diff - ${.CURDIR}/rsa_openssh.prv
|
2010-11-05 08:23:38 +01:00
|
|
|
awk '{print $$0 "\r"}' ${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_crnl.prv
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -if ${.OBJDIR}/rsa_ssh2_crnl.prv | diff - ${.CURDIR}/rsa_openssh.prv
|
2002-05-01 05:17:33 +02:00
|
|
|
|
|
|
|
t2:
|
2003-09-09 15:07:10 +02:00
|
|
|
cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out
|
|
|
|
chmod 600 $(OBJ)/t2.out
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub
|
2002-05-01 05:17:33 +02:00
|
|
|
|
|
|
|
t3:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/t3.out
|
|
|
|
${TEST_SSH_SSHKEYGEN} -if $(OBJ)/t3.out | diff - ${.CURDIR}/rsa_openssh.pub
|
2002-05-01 05:17:33 +02:00
|
|
|
|
|
|
|
t4:
|
2014-12-22 03:15:52 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -E md5 -lf ${.CURDIR}/rsa_openssh.pub |\
|
2002-05-01 05:17:33 +02:00
|
|
|
awk '{print $$2}' | diff - ${.CURDIR}/t4.ok
|
|
|
|
|
|
|
|
t5:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -Bf ${.CURDIR}/rsa_openssh.pub |\
|
2002-05-01 05:17:33 +02:00
|
|
|
awk '{print $$2}' | diff - ${.CURDIR}/t5.ok
|
|
|
|
|
|
|
|
t6:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1
|
|
|
|
${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2
|
2003-09-09 15:07:10 +02:00
|
|
|
chmod 600 $(OBJ)/t6.out1
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2003-09-09 15:07:10 +02:00
|
|
|
$(OBJ)/t7.out:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -q -t rsa -N '' -f $@
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2003-09-09 15:07:10 +02:00
|
|
|
t7: $(OBJ)/t7.out
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t7.out > /dev/null
|
|
|
|
${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t7.out > /dev/null
|
2002-05-01 05:17:33 +02:00
|
|
|
|
2010-11-07 22:00:27 +01:00
|
|
|
$(OBJ)/t8.out:
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -q -t dsa -N '' -f $@
|
2010-11-05 08:23:38 +01:00
|
|
|
|
2010-11-07 22:00:27 +01:00
|
|
|
t8: $(OBJ)/t8.out
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t8.out > /dev/null
|
|
|
|
${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t8.out > /dev/null
|
2010-11-05 08:23:38 +01:00
|
|
|
|
2010-11-07 22:00:27 +01:00
|
|
|
$(OBJ)/t9.out:
|
2010-11-05 08:23:38 +01:00
|
|
|
test "${TEST_SSH_ECC}" != yes || \
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -q -t ecdsa -N '' -f $@
|
2010-11-05 08:23:38 +01:00
|
|
|
|
2010-11-07 22:00:27 +01:00
|
|
|
t9: $(OBJ)/t9.out
|
2010-11-05 08:23:38 +01:00
|
|
|
test "${TEST_SSH_ECC}" != yes || \
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t9.out > /dev/null
|
2010-11-05 08:23:38 +01:00
|
|
|
test "${TEST_SSH_ECC}" != yes || \
|
2011-01-17 00:51:40 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t9.out > /dev/null
|
2010-11-05 08:23:38 +01:00
|
|
|
|
2013-12-07 06:32:44 +01:00
|
|
|
|
|
|
|
$(OBJ)/t10.out:
|
|
|
|
${TEST_SSH_SSHKEYGEN} -q -t ed25519 -N '' -f $@
|
|
|
|
|
|
|
|
t10: $(OBJ)/t10.out
|
|
|
|
${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t10.out > /dev/null
|
|
|
|
${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t10.out > /dev/null
|
|
|
|
|
2014-12-22 03:15:52 +01:00
|
|
|
t11:
|
|
|
|
${TEST_SSH_SSHKEYGEN} -E sha256 -lf ${.CURDIR}/rsa_openssh.pub |\
|
|
|
|
awk '{print $$2}' | diff - ${.CURDIR}/t11.ok
|
|
|
|
|
2015-06-10 07:41:13 +02:00
|
|
|
$(OBJ)/t12.out:
|
|
|
|
${TEST_SSH_SSHKEYGEN} -q -t ed25519 -N '' -C 'test-comment-1234' -f $@
|
2015-01-12 21:13:27 +01:00
|
|
|
|
2015-06-10 07:41:13 +02:00
|
|
|
t12: $(OBJ)/t12.out
|
2015-03-17 06:49:20 +01:00
|
|
|
${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t12.out.pub | grep test-comment-1234 >/dev/null
|
2015-01-12 21:13:27 +01:00
|
|
|
|
2012-12-12 02:51:54 +01:00
|
|
|
t-exec: ${LTESTS:=.sh}
|
2003-09-04 07:37:58 +02:00
|
|
|
@if [ "x$?" = "x" ]; then exit 0; fi; \
|
|
|
|
for TEST in ""$?; do \
|
2019-09-30 06:11:42 +02:00
|
|
|
skip=no; \
|
|
|
|
for t in ""$${SKIP_LTESTS}; do \
|
|
|
|
if [ "x$${t}.sh" = "x$${TEST}" ]; then skip=yes; fi; \
|
|
|
|
done; \
|
|
|
|
if [ "x$${skip}" = "xno" ]; then \
|
|
|
|
echo "run test $${TEST}" ... 1>&2; \
|
|
|
|
(env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
|
|
|
|
else \
|
|
|
|
echo skip test $${TEST} 1>&2; \
|
|
|
|
fi; \
|
2003-09-04 07:37:58 +02:00
|
|
|
done
|
2008-03-12 14:17:00 +01:00
|
|
|
|
|
|
|
t-exec-interop: ${INTEROP_TESTS:=.sh}
|
2019-01-21 00:24:19 +01:00
|
|
|
@if [ "x$?" = "x" ]; then exit 0; fi; \
|
|
|
|
for TEST in ""$?; do \
|
|
|
|
echo "run test $${TEST}" ... 1>&2; \
|
|
|
|
(env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
|
|
|
|
done
|
|
|
|
|
|
|
|
t-extra: ${EXTRA_TESTS:=.sh}
|
2008-03-12 14:17:00 +01:00
|
|
|
@if [ "x$?" = "x" ]; then exit 0; fi; \
|
|
|
|
for TEST in ""$?; do \
|
|
|
|
echo "run test $${TEST}" ... 1>&2; \
|
2013-06-02 23:05:48 +02:00
|
|
|
(env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
|
2008-03-12 14:17:00 +01:00
|
|
|
done
|
|
|
|
|
2010-11-05 08:23:38 +01:00
|
|
|
# Not run by default
|
|
|
|
interop: ${INTEROP_TARGETS}
|
2014-05-15 10:01:01 +02:00
|
|
|
|
|
|
|
# Unit tests, built by top-level Makefile
|
|
|
|
unit:
|
2014-07-02 09:38:31 +02:00
|
|
|
set -e ; if test -z "${SKIP_UNIT}" ; then \
|
2015-02-26 01:58:22 +01:00
|
|
|
V="" ; \
|
2015-02-28 00:52:49 +01:00
|
|
|
test "x${USE_VALGRIND}" = "x" || \
|
2015-02-26 01:58:22 +01:00
|
|
|
V=${.CURDIR}/valgrind-unit.sh ; \
|
|
|
|
$$V ${.OBJDIR}/unittests/sshbuf/test_sshbuf ; \
|
|
|
|
$$V ${.OBJDIR}/unittests/sshkey/test_sshkey \
|
2015-02-17 00:04:55 +01:00
|
|
|
-d ${.CURDIR}/unittests/sshkey/testdata ; \
|
2015-02-26 01:58:22 +01:00
|
|
|
$$V ${.OBJDIR}/unittests/bitmap/test_bitmap ; \
|
2017-03-14 04:19:36 +01:00
|
|
|
$$V ${.OBJDIR}/unittests/conversion/test_conversion ; \
|
2015-02-26 01:58:22 +01:00
|
|
|
$$V ${.OBJDIR}/unittests/kex/test_kex ; \
|
|
|
|
$$V ${.OBJDIR}/unittests/hostkeys/test_hostkeys \
|
2015-02-17 00:04:55 +01:00
|
|
|
-d ${.CURDIR}/unittests/hostkeys/testdata ; \
|
2016-08-23 08:33:48 +02:00
|
|
|
$$V ${.OBJDIR}/unittests/match/test_match ; \
|
2016-12-08 05:48:34 +01:00
|
|
|
if test "x${TEST_SSH_UTF8}" = "xyes" ; then \
|
|
|
|
$$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \
|
|
|
|
fi \
|
2014-07-02 09:38:31 +02:00
|
|
|
fi
|