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