summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--regress/keytype.sh48
2 files changed, 49 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 65e0f9e3e..2f309739d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,7 @@
42 non-LOGIN_CAP case into platform.c. 42 non-LOGIN_CAP case into platform.c.
43 - (dtucker) [platform.c platform.h session.c] Move the Cygwin special-case 43 - (dtucker) [platform.c platform.h session.c] Move the Cygwin special-case
44 check into platform.c 44 check into platform.c
45 - (dtucker) [regress/keytype.sh] Import new test.
45 46
4620101025 4720101025
47 - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with 48 - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with
diff --git a/regress/keytype.sh b/regress/keytype.sh
new file mode 100644
index 000000000..7be3cc0c8
--- /dev/null
+++ b/regress/keytype.sh
@@ -0,0 +1,48 @@
1# $OpenBSD: keytype.sh,v 1.1 2010/09/02 16:12:55 markus Exp $
2# Placed in the Public Domain.
3
4tid="login with different key types"
5
6TIME=/usr/bin/time
7cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
8cp $OBJ/ssh_proxy $OBJ/ssh_proxy_bak
9
10ktypes="dsa-1024 rsa-2048 ecdsa-256 rsa-3072 ecdsa-384 ecdsa-521"
11
12for kt in $ktypes; do
13 rm -f $OBJ/key.$kt
14 bits=${kt#*-}
15 type=${kt%-*}
16 printf "keygen $type, $bits bits:\t"
17 ${TIME} ${SSHKEYGEN} -b $bits -q -N '' -t $type -f $OBJ/key.$kt ||\
18 fail "ssh-keygen for type $type, $bits bits failed"
19done
20
21tries="1 2 3"
22for ut in $ktypes; do
23 htypes=$ut
24 #htypes=$ktypes
25 for ht in $htypes; do
26 trace "ssh connect, userkey $ut, hostkey $ht"
27 (
28 grep -v HostKey $OBJ/sshd_proxy_bak
29 echo HostKey $OBJ/key.$ht
30 ) > $OBJ/sshd_proxy
31 (
32 grep -v IdentityFile $OBJ/ssh_proxy_bak
33 echo IdentityFile $OBJ/key.$ut
34 ) > $OBJ/ssh_proxy
35 (
36 echo -n 'localhost-with-alias,127.0.0.1,::1 '
37 cat $OBJ/key.$ht.pub
38 ) > $OBJ/known_hosts
39 cat $OBJ/key.$ut.pub > $OBJ/authorized_keys_$USER
40 for i in $tries; do
41 printf "userkey $ut, hostkey ${ht}:\t"
42 ${TIME} ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
43 if [ $? -ne 0 ]; then
44 fail "ssh userkey $ut, hostkey $ht failed"
45 fi
46 done
47 done
48done