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