blob: 85fd3a5adc9348febdb4fa04d09507720cab8f23 [file] [log] [blame]
Damien Miller7d06b002011-01-07 09:54:20 +11001# $OpenBSD: Makefile,v 1.58 2011/01/06 22:46:21 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002
Damien Miller3a0e9f62010-11-05 10:16:34 +11003REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t-exec
Darren Tuckerebc3c132003-09-04 15:37:58 +10004tests: $(REGRESS_TARGETS)
Damien Miller38cd4352002-05-01 13:17:33 +10005
Damien Milleraf784932008-03-13 00:17:00 +11006# Interop tests are not run by default
Damien Miller66429962008-03-13 12:05:40 +11007interop interop-tests: t-exec-interop
Damien Milleraf784932008-03-13 00:17:00 +11008
Darren Tuckerebc3c132003-09-04 15:37:58 +10009clean:
Darren Tuckerb12d16f2003-09-14 11:40:35 +100010 for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done
Damien Miller9c8a4272008-03-27 17:42:06 +110011 rm -rf $(OBJ).putty
12
Darren Tuckerebc3c132003-09-04 15:37:58 +100013distclean: clean
Damien Miller38cd4352002-05-01 13:17:33 +100014
15LTESTS= connect \
16 proxy-connect \
17 connect-privsep \
18 proto-version \
19 proto-mismatch \
20 exit-status \
Darren Tucker4c37ef02004-06-16 20:08:56 +100021 envpass \
Damien Miller38cd4352002-05-01 13:17:33 +100022 transfer \
Darren Tuckerdc001a52003-10-08 17:47:19 +100023 banner \
Darren Tuckerd57a76e2003-06-18 22:32:51 +100024 rekey \
Damien Miller38cd4352002-05-01 13:17:33 +100025 stderr-data \
26 stderr-after-eof \
27 broken-pipe \
28 try-ciphers \
29 yes-head \
Darren Tucker017fd612004-02-29 20:30:17 +110030 login-timeout \
Damien Miller38cd4352002-05-01 13:17:33 +100031 agent \
Damien Miller8b9cde72003-01-22 17:53:16 +110032 agent-getpeereid \
33 agent-timeout \
34 agent-ptrace \
Damien Miller38cd4352002-05-01 13:17:33 +100035 keyscan \
Damien Miller8b9cde72003-01-22 17:53:16 +110036 keygen-change \
Damien Millerb6bd3c22010-02-24 17:24:56 +110037 keygen-convert \
Damien Miller2e80cf22008-06-30 08:06:25 +100038 key-options \
Darren Tucker50433a92004-06-16 20:15:59 +100039 scp \
Damien Miller38cd4352002-05-01 13:17:33 +100040 sftp \
Damien Miller8b9cde72003-01-22 17:53:16 +110041 sftp-cmds \
Darren Tuckera4040f52003-06-18 22:35:11 +100042 sftp-badcmds \
Damien Miller8b9cde72003-01-22 17:53:16 +110043 sftp-batch \
Darren Tucker1c56ef62005-03-07 17:36:18 +110044 sftp-glob \
Darren Tucker50cea672003-06-18 22:45:34 +100045 reconfigure \
Darren Tuckere2f2be72003-07-03 20:27:55 +100046 dynamic-forward \
Darren Tuckere7d05832004-06-16 20:22:22 +100047 forwarding \
Darren Tucker977a9d22004-06-25 13:45:18 +100048 multiplex \
Darren Tucker124f58e2004-12-06 23:07:37 +110049 reexec \
Damien Miller7b1877c2006-07-24 15:31:41 +100050 brokenkeys \
51 cfgmatch \
Darren Tucker10f92422008-06-10 23:16:46 +100052 addrmatch \
Damien Millera5e58422008-03-12 23:58:05 +110053 localcommand \
Darren Tucker287b9322009-10-07 10:31:56 +110054 forcecommand \
Damien Miller58ac6de2010-02-27 07:57:12 +110055 portnum \
Darren Tuckereab5f0d2010-11-05 18:23:38 +110056 keytype \
57 kextype \
Damien Miller58ac6de2010-02-27 07:57:12 +110058 cert-hostkey \
Damien Miller7d06b002011-01-07 09:54:20 +110059 cert-userkey \
60 host-expand
Damien Miller38cd4352002-05-01 13:17:33 +100061
Damien Miller4268a132008-06-30 08:07:56 +100062INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers
Damien Milleraf784932008-03-13 00:17:00 +110063#INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp
64
Darren Tuckereab5f0d2010-11-05 18:23:38 +110065#LTESTS= cipher-speed
66
Damien Miller38cd4352002-05-01 13:17:33 +100067USER!= id -un
Darren Tucker7b6cb5c2003-09-14 13:16:55 +100068CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
Damien Miller3a0e9f62010-11-05 10:16:34 +110069 t8.out t8.out.pub t9.out t9.out.pub \
Darren Tucker7b6cb5c2003-09-14 13:16:55 +100070 authorized_keys_${USER} known_hosts pidfile \
Darren Tucker3206e572004-12-06 23:04:57 +110071 ssh_config sshd_config.orig ssh_proxy sshd_config sshd_proxy \
Damien Miller38cd4352002-05-01 13:17:33 +100072 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \
73 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
Darren Tucker50433a92004-06-16 20:15:59 +100074 ls.copy banner.in banner.out empty.in \
Damien Miller7b1877c2006-07-24 15:31:41 +100075 scp-ssh-wrapper.scp ssh_proxy_envpass remote_pid \
Damien Miller9c8a4272008-03-27 17:42:06 +110076 sshd_proxy_bak rsa_ssh2_cr.prv rsa_ssh2_crnl.prv \
Damien Miller58ac6de2010-02-27 07:57:12 +110077 known_hosts-cert host_ca_key* cert_host_key* \
Damien Miller3bcce802010-05-21 14:48:16 +100078 putty.rsa2 sshd_proxy_orig \
Damien Miller7d06b002011-01-07 09:54:20 +110079 authorized_principals_${USER} expect actual
Damien Miller38cd4352002-05-01 13:17:33 +100080
Damien Miller8f9492c2010-02-24 17:28:45 +110081# Enable all malloc(3) randomisations and checks
82TEST_ENV= "MALLOC_OPTIONS=AFGJPRX"
83
Damien Miller38cd4352002-05-01 13:17:33 +100084t1:
85 ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
Darren Tuckereab5f0d2010-11-05 18:23:38 +110086 tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv
87 ssh-keygen -if ${.OBJDIR}/rsa_ssh2_cr.prv | diff - ${.CURDIR}/rsa_openssh.prv
88 awk '{print $$0 "\r"}' ${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_crnl.prv
89 ssh-keygen -if ${.OBJDIR}/rsa_ssh2_crnl.prv | diff - ${.CURDIR}/rsa_openssh.prv
Damien Miller38cd4352002-05-01 13:17:33 +100090
91t2:
Tim Rice8b2157d2003-09-09 06:07:10 -070092 cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out
93 chmod 600 $(OBJ)/t2.out
94 ssh-keygen -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub
Damien Miller38cd4352002-05-01 13:17:33 +100095
96t3:
Darren Tuckerebc3c132003-09-04 15:37:58 +100097 ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/rsa_secsh.pub
98 ssh-keygen -if $(OBJ)/rsa_secsh.pub | diff - ${.CURDIR}/rsa_openssh.pub
99 rm -f ${.CURDIR}/rsa_secsh.pub
Damien Miller38cd4352002-05-01 13:17:33 +1000100
101t4:
102 ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\
103 awk '{print $$2}' | diff - ${.CURDIR}/t4.ok
104
105t5:
106 ssh-keygen -Bf ${.CURDIR}/rsa_openssh.pub |\
107 awk '{print $$2}' | diff - ${.CURDIR}/t5.ok
108
109t6:
Tim Rice8b2157d2003-09-09 06:07:10 -0700110 ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1
111 ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2
112 chmod 600 $(OBJ)/t6.out1
113 ssh-keygen -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2
Damien Miller38cd4352002-05-01 13:17:33 +1000114
Tim Rice8b2157d2003-09-09 06:07:10 -0700115$(OBJ)/t7.out:
Damien Miller38cd4352002-05-01 13:17:33 +1000116 ssh-keygen -q -t rsa -N '' -f $@
117
Tim Rice8b2157d2003-09-09 06:07:10 -0700118t7: $(OBJ)/t7.out
119 ssh-keygen -lf $(OBJ)/t7.out > /dev/null
120 ssh-keygen -Bf $(OBJ)/t7.out > /dev/null
Damien Miller38cd4352002-05-01 13:17:33 +1000121
Tim Rice522262f2010-11-07 13:00:27 -0800122$(OBJ)/t8.out:
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100123 ssh-keygen -q -t dsa -N '' -f $@
124
Tim Rice522262f2010-11-07 13:00:27 -0800125t8: $(OBJ)/t8.out
126 ssh-keygen -lf $(OBJ)/t8.out > /dev/null
127 ssh-keygen -Bf $(OBJ)/t8.out > /dev/null
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100128
Tim Rice522262f2010-11-07 13:00:27 -0800129$(OBJ)/t9.out:
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100130 test "${TEST_SSH_ECC}" != yes || \
Tim Rice522262f2010-11-07 13:00:27 -0800131 ssh-keygen -q -t ecdsa -N '' -f $@
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100132
Tim Rice522262f2010-11-07 13:00:27 -0800133t9: $(OBJ)/t9.out
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100134 test "${TEST_SSH_ECC}" != yes || \
Tim Rice522262f2010-11-07 13:00:27 -0800135 ssh-keygen -lf $(OBJ)/t9.out > /dev/null
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100136 test "${TEST_SSH_ECC}" != yes || \
Tim Rice522262f2010-11-07 13:00:27 -0800137 ssh-keygen -Bf $(OBJ)/t9.out > /dev/null
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100138
Darren Tuckerebc3c132003-09-04 15:37:58 +1000139t-exec: ${LTESTS:=.sh}
140 @if [ "x$?" = "x" ]; then exit 0; fi; \
141 for TEST in ""$?; do \
142 echo "run test $${TEST}" ... 1>&2; \
Damien Miller527ded72010-07-02 13:40:16 +1000143 (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
Darren Tuckerebc3c132003-09-04 15:37:58 +1000144 done
Damien Milleraf784932008-03-13 00:17:00 +1100145
146t-exec-interop: ${INTEROP_TESTS:=.sh}
147 @if [ "x$?" = "x" ]; then exit 0; fi; \
148 for TEST in ""$?; do \
149 echo "run test $${TEST}" ... 1>&2; \
Damien Miller527ded72010-07-02 13:40:16 +1000150 (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
Damien Milleraf784932008-03-13 00:17:00 +1100151 done
152
Darren Tuckereab5f0d2010-11-05 18:23:38 +1100153# Not run by default
154interop: ${INTEROP_TARGETS}