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