1 # $OpenBSD: keytype.sh,v 1.1 2010/09/02 16:12:55 markus Exp $
2 # Placed in the Public Domain.
4 tid
="login with different key types"
6 TIME
=`which time` 2>/dev
/null
7 if test ! -x "$TIME"; then
11 cp $OBJ/sshd_proxy
$OBJ/sshd_proxy_bak
12 cp $OBJ/ssh_proxy
$OBJ/ssh_proxy_bak
14 ktypes
="dsa-1024 rsa-2048 rsa-3072"
15 if test "$TEST_SSH_ECC" = "yes"; then
16 ktypes
="$ktypes ecdsa-256 ecdsa-384 ecdsa-521"
21 bits
=`echo ${kt} | awk -F- '{print $2}'`
22 type=`echo ${kt} | awk -F- '{print $1}'`
23 printf "keygen $type, $bits bits:\t"
24 ${TIME} ${SSHKEYGEN} -b $bits -q -N '' -t $type -f $OBJ/key.
$kt ||\
25 fail
"ssh-keygen for type $type, $bits bits failed"
33 trace
"ssh connect, userkey $ut, hostkey $ht"
35 grep -v HostKey
$OBJ/sshd_proxy_bak
36 echo HostKey
$OBJ/key.
$ht
39 grep -v IdentityFile
$OBJ/ssh_proxy_bak
40 echo IdentityFile
$OBJ/key.
$ut
43 echon
'localhost-with-alias,127.0.0.1,::1 '
46 cat $OBJ/key.
$ut.pub
> $OBJ/authorized_keys_
$USER
48 printf "userkey $ut, hostkey ${ht}:\t"
49 ${TIME} ${SSH} -F $OBJ/ssh_proxy
999.999.999.999 true
51 fail
"ssh userkey $ut, hostkey $ht failed"