summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2004-10-29 23:59:23 +0000
committerDamien Miller <djm@cvs.openbsd.org>2004-10-29 23:59:23 +0000
commitf6f1b05bdf232485e35c9fab471767c226cd4d13 (patch)
tree1bf5258df05608402768d6b63c536df9adf57cb7 /regress/usr.bin/ssh
parenta5f048f3884b0872e0375654e127901126b007fb (diff)
regression test for handling of corrupt keys in authorized_keys file
Diffstat (limited to 'regress/usr.bin/ssh')
-rw-r--r--regress/usr.bin/ssh/Makefile5
-rw-r--r--regress/usr.bin/ssh/brokenkeys.sh23
2 files changed, 26 insertions, 2 deletions
diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile
index e5ae3128150..80d68fcc394 100644
--- a/regress/usr.bin/ssh/Makefile
+++ b/regress/usr.bin/ssh/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.32 2004/07/09 19:45:43 david Exp $
+# $OpenBSD: Makefile,v 1.33 2004/10/29 23:59:22 djm Exp $
REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7
@@ -35,7 +35,8 @@ LTESTS= connect \
dynamic-forward \
forwarding \
multiplex \
- reexec
+ reexec \
+ brokenkeys
USER!= id -un
CLEANFILES+= authorized_keys_${USER} known_hosts pidfile \
diff --git a/regress/usr.bin/ssh/brokenkeys.sh b/regress/usr.bin/ssh/brokenkeys.sh
new file mode 100644
index 00000000000..3e70c348ac3
--- /dev/null
+++ b/regress/usr.bin/ssh/brokenkeys.sh
@@ -0,0 +1,23 @@
+# $OpenBSD: brokenkeys.sh,v 1.1 2004/10/29 23:59:22 djm Exp $
+# Placed in the Public Domain.
+
+tid="broken keys"
+
+KEYS="$OBJ/authorized_keys_${USER}"
+
+start_sshd
+
+mv ${KEYS} ${KEYS}.bak
+
+# Truncated key
+echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEABTM= bad key" > $KEYS
+cat ${KEYS}.bak >> ${KEYS}
+cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER
+
+${SSH} -2 -F $OBJ/ssh_config somehost true
+if [ $? -ne 0 ]; then
+ fail "ssh connect with protocol $p failed"
+fi
+
+mv ${KEYS}.bak ${KEYS}
+