summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-03-27 22:40:28 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-03-27 22:40:28 +0000
commit22cdd3a1fd958a1736b9d1f41355ef989aeb7308 (patch)
treecb338991d3f43c186ec5066eb8df7ca28de1ea0e
parent0db51bc0b067694c73eb667d029b9aa61e7ab669 (diff)
test key import
-rw-r--r--regress/usr.bin/ssh/Makefile4
-rw-r--r--regress/usr.bin/ssh/ssh-com-keygen.sh67
2 files changed, 69 insertions, 2 deletions
diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile
index 96eb505ad0b..d64b696cff0 100644
--- a/regress/usr.bin/ssh/Makefile
+++ b/regress/usr.bin/ssh/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.11 2002/03/27 00:03:37 markus Exp $
+# $OpenBSD: Makefile,v 1.12 2002/03/27 22:40:27 markus Exp $
REGRESSTARGETS= t1 t2 t3 t4 t5 t6 t7
@@ -28,7 +28,7 @@ CLEANFILES+= authorized_keys_${USER} known_hosts pidfile \
rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
ls.copy
-#LTESTS+= ssh-com ssh-com-client
+#LTESTS+= ssh-com ssh-com-client ssh-com-keygen
t1:
ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
diff --git a/regress/usr.bin/ssh/ssh-com-keygen.sh b/regress/usr.bin/ssh/ssh-com-keygen.sh
new file mode 100644
index 00000000000..90ba2fcdc0a
--- /dev/null
+++ b/regress/usr.bin/ssh/ssh-com-keygen.sh
@@ -0,0 +1,67 @@
+# $OpenBSD: ssh-com-keygen.sh,v 1.1 2002/03/27 22:40:27 markus Exp $
+# Placed in the Public Domain.
+
+tid="ssh.com key import"
+
+#TEST_COMBASE=/path/to/ssh/com/binaries
+if [ "X${TEST_COMBASE}" = "X" ]; then
+ fatal '$TEST_COMBASE is not set'
+fi
+
+VERSIONS="
+ 2.0.10
+ 2.0.12
+ 2.0.13
+ 2.1.0
+ 2.2.0
+ 2.3.0
+ 2.3.1
+ 2.4.0
+ 3.0.0
+ 3.1.0"
+
+COMPRV=${OBJ}/comkey
+COMPUB=${COMPRV}.pub
+OPENSSHPRV=${OBJ}/opensshkey
+OPENSSHPUB=${OPENSSHPRV}.pub
+
+# go for it
+for v in ${VERSIONS}; do
+ keygen=${TEST_COMBASE}/${v}/ssh-keygen2
+ if [ ! -x ${keygen} ]; then
+ continue
+ fi
+ types="dss"
+ case $v in
+ 2.3.1|3.*)
+ types="$types rsa"
+ ;;
+ esac
+ for t in $types; do
+ verbose "ssh-keygen $v/$t"
+ rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB
+ ${keygen} -q -P -t $t ${COMPRV} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ fail "${keygen} -t $t failed"
+ continue
+ fi
+ ${SSHKEYGEN} -if ${COMPUB} > ${OPENSSHPUB}
+ if [ $? -ne 0 ]; then
+ fail "import public key ($v/$t) failed"
+ continue
+ fi
+ ${SSHKEYGEN} -if ${COMPRV} > ${OPENSSHPRV}
+ if [ $? -ne 0 ]; then
+ fail "import private key ($v/$t) failed"
+ continue
+ fi
+ chmod 600 ${OPENSSHPRV}
+ ${SSHKEYGEN} -yf ${OPENSSHPRV} |\
+ diff - ${OPENSSHPUB}
+ if [ $? -ne 0 ]; then
+ fail "public keys ($v/$t) differ"
+ fi
+ done
+done
+
+rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB