summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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}
+