1# $OpenBSD: Makefile,v 1.88 2016/06/03 04:10:41 dtucker Exp $ 2 3.ifndef SKIP_UNIT 4SUBDIR= unittests 5.endif 6SUBDIR+= misc 7 8REGRESS_FAIL_EARLY= yes 9REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 10 11LTESTS= connect \ 12 proxy-connect \ 13 connect-privsep \ 14 proto-version \ 15 proto-mismatch \ 16 exit-status \ 17 envpass \ 18 transfer \ 19 banner \ 20 rekey \ 21 dhgex \ 22 stderr-data \ 23 stderr-after-eof \ 24 broken-pipe \ 25 try-ciphers \ 26 yes-head \ 27 login-timeout \ 28 agent \ 29 agent-getpeereid \ 30 agent-timeout \ 31 agent-ptrace \ 32 keyscan \ 33 keygen-change \ 34 keygen-convert \ 35 key-options \ 36 scp \ 37 sftp \ 38 sftp-chroot \ 39 sftp-cmds \ 40 sftp-badcmds \ 41 sftp-batch \ 42 sftp-glob \ 43 sftp-perm \ 44 reconfigure \ 45 dynamic-forward \ 46 forwarding \ 47 multiplex \ 48 reexec \ 49 brokenkeys \ 50 sshcfgparse \ 51 cfgparse \ 52 cfgmatch \ 53 addrmatch \ 54 localcommand \ 55 forcecommand \ 56 portnum \ 57 keytype \ 58 kextype \ 59 cert-hostkey \ 60 cert-userkey \ 61 host-expand \ 62 keys-command \ 63 forward-control \ 64 integrity \ 65 krl \ 66 multipubkey \ 67 limit-keytype \ 68 hostkey-agent \ 69 keygen-knownhosts \ 70 hostkey-rotate \ 71 principals-command \ 72 cert-file \ 73 cfginclude 74 75INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers 76#INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp 77 78#LTESTS= cipher-speed 79 80USER!= id -un 81CLEANFILES+= *.core actual agent-key.* authorized_keys_${USER} \ 82 authorized_keys_${USER}.* authorized_principals_${USER} \ 83 banner.in banner.out cert_host_key* cert_user_key* \ 84 copy.1 copy.2 data ed25519-agent ed25519-agent* \ 85 ed25519-agent.pub empty.in expect failed-regress.log \ 86 failed-ssh.log failed-sshd.log hkr.* host.rsa host.rsa1 \ 87 host_* host_ca_key* host_krl_* host_revoked_* key.* \ 88 key.dsa-* key.ecdsa-* key.ed25519-512 key.ed25519-512.pub \ 89 key.rsa-* keys-command-args kh.* known_hosts \ 90 known_hosts-cert known_hosts.* krl-* ls.copy modpipe \ 91 netcat pidfile putty.rsa2 ready regress.log remote_pid \ 92 revoked-* rsa rsa-agent rsa-agent.pub rsa.pub rsa1 \ 93 rsa1-agent rsa1-agent.pub rsa1.pub rsa_ssh2_cr.prv \ 94 rsa_ssh2_crnl.prv scp-ssh-wrapper.exe \ 95 scp-ssh-wrapper.scp setuid-allowed sftp-server.log \ 96 sftp-server.sh sftp.log ssh-log-wrapper.sh ssh.log \ 97 ssh_config ssh_config.* ssh_proxy ssh_proxy_bak \ 98 ssh_proxy_envpass sshd.log sshd_config sshd_config.orig \ 99 sshd_proxy sshd_proxy.* sshd_proxy_bak sshd_proxy_orig \ 100 t10.out t10.out.pub t12.out t12.out.pub t2.out t3.out \ 101 t6.out1 t6.out2 t7.out t7.out.pub t8.out t8.out.pub \ 102 t9.out t9.out.pub testdata user_*key* user_ca* user_key* 103 104SUDO_CLEAN+= /var/run/testdata_${USER} /var/run/keycommand_${USER} 105 106# Enable all malloc(3) randomisations and checks 107TEST_ENV= "MALLOC_OPTIONS=AFGJPRX" 108 109t1: 110 ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv 111 tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv 112 ssh-keygen -if ${.OBJDIR}/rsa_ssh2_cr.prv | diff - ${.CURDIR}/rsa_openssh.prv 113 awk '{print $$0 "\r"}' ${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_crnl.prv 114 ssh-keygen -if ${.OBJDIR}/rsa_ssh2_crnl.prv | diff - ${.CURDIR}/rsa_openssh.prv 115 116t2: 117 cat ${.CURDIR}/rsa_openssh.prv > t2.out 118 chmod 600 t2.out 119 ssh-keygen -yf t2.out | diff - ${.CURDIR}/rsa_openssh.pub 120 121t3: 122 ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub |\ 123 ssh-keygen -if /dev/stdin |\ 124 diff - ${.CURDIR}/rsa_openssh.pub 125 126t4: 127 ssh-keygen -E md5 -lf ${.CURDIR}/rsa_openssh.pub |\ 128 awk '{print $$2}' | diff - ${.CURDIR}/t4.ok 129 130t5: 131 ssh-keygen -Bf ${.CURDIR}/rsa_openssh.pub |\ 132 awk '{print $$2}' | diff - ${.CURDIR}/t5.ok 133 134t6: 135 ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > t6.out1 136 ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > t6.out2 137 chmod 600 t6.out1 138 ssh-keygen -yf t6.out1 | diff - t6.out2 139 140t7.out: 141 ssh-keygen -q -t rsa -N '' -f $@ 142 143t7: t7.out 144 ssh-keygen -lf t7.out > /dev/null 145 ssh-keygen -Bf t7.out > /dev/null 146 147t8.out: 148 ssh-keygen -q -t dsa -N '' -f $@ 149 150t8: t8.out 151 ssh-keygen -lf t8.out > /dev/null 152 ssh-keygen -Bf t8.out > /dev/null 153 154t9.out: 155 ssh-keygen -q -t ecdsa -N '' -f $@ 156 157t9: t9.out 158 ssh-keygen -lf t9.out > /dev/null 159 ssh-keygen -Bf t9.out > /dev/null 160 161t10.out: 162 ssh-keygen -q -t ed25519 -N '' -f $@ 163 164t10: t10.out 165 ssh-keygen -lf t10.out > /dev/null 166 ssh-keygen -Bf t10.out > /dev/null 167 168t11: 169 ssh-keygen -E sha256 -lf ${.CURDIR}/rsa_openssh.pub |\ 170 awk '{print $$2}' | diff - ${.CURDIR}/t11.ok 171 172t12.out: 173 ssh-keygen -q -t ed25519 -N '' -C 'test-comment-1234' -f $@ 174 175t12: t12.out 176 ssh-keygen -lf t12.out.pub | grep -q test-comment-1234 177 178modpipe: modpipe.c 179 180t-integrity: modpipe 181 182.for t in ${LTESTS} ${INTEROP_TESTS} 183t-${t}: 184 env SUDO="${SUDO}" ${TEST_ENV} \ 185 sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh 186.endfor 187 188.for t in ${LTESTS} 189REGRESS_TARGETS+=t-${t} 190.endfor 191 192.for t in ${INTEROP_TESTS} 193INTEROP_TARGETS+=t-${t} 194.endfor 195 196# Not run by default 197interop: ${INTEROP_TARGETS} 198 199.for s in ${SUBDIR} 200CLEAN_SUBDIR+=c-${s} 201c-${s}: 202 ${MAKE} -C ${.CURDIR}/${s} clean 203.endfor 204 205clean: ${CLEAN_SUBDIR} 206 rm -f ${CLEANFILES} 207 test -z "${SUDO}" || ${SUDO} rm -f ${SUDO_CLEAN} 208 rm -rf .putty 209 210.include <bsd.regress.mk> 211