summaryrefslogtreecommitdiff
path: root/regress/brokenkeys.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-12-06 23:07:37 +1100
committerDarren Tucker <dtucker@zip.com.au>2004-12-06 23:07:37 +1100
commit124f58ecba39525af88e0619105656d383e515ff (patch)
tree48635c04c9946c34c2ce2cae0543cd4c4153d320 /regress/brokenkeys.sh
parent71b5643598d301a1a03c4845ff0eb159998a5fcf (diff)
- djm@cvs.openbsd.org 2004/10/29 23:59:22
[Makefile added brokenkeys.sh] regression test for handling of corrupt keys in authorized_keys file
Diffstat (limited to 'regress/brokenkeys.sh')
-rw-r--r--regress/brokenkeys.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/regress/brokenkeys.sh b/regress/brokenkeys.sh
new file mode 100644
index 00000000..3e70c348
--- /dev/null
+++ b/regress/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}
+