ssh-com-keygen.sh revision 113908
1# $OpenBSD: ssh-com-keygen.sh,v 1.2 2002/07/16 08:58:16 markus Exp $ 2# Placed in the Public Domain. 3 4tid="ssh.com key import" 5 6#TEST_COMBASE=/path/to/ssh/com/binaries 7if [ "X${TEST_COMBASE}" = "X" ]; then 8 fatal '$TEST_COMBASE is not set' 9fi 10 11VERSIONS=" 12 2.0.10 13 2.0.12 14 2.0.13 15 2.1.0 16 2.2.0 17 2.3.0 18 2.3.1 19 2.4.0 20 3.0.0 21 3.1.0 22 3.2.0 23 3.3.0" 24 25COMPRV=${OBJ}/comkey 26COMPUB=${COMPRV}.pub 27OPENSSHPRV=${OBJ}/opensshkey 28OPENSSHPUB=${OPENSSHPRV}.pub 29 30# go for it 31for v in ${VERSIONS}; do 32 keygen=${TEST_COMBASE}/${v}/ssh-keygen2 33 if [ ! -x ${keygen} ]; then 34 continue 35 fi 36 types="dss" 37 case $v in 38 2.3.1|3.*) 39 types="$types rsa" 40 ;; 41 esac 42 for t in $types; do 43 verbose "ssh-keygen $v/$t" 44 rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB 45 ${keygen} -q -P -t $t ${COMPRV} > /dev/null 2>&1 46 if [ $? -ne 0 ]; then 47 fail "${keygen} -t $t failed" 48 continue 49 fi 50 ${SSHKEYGEN} -if ${COMPUB} > ${OPENSSHPUB} 51 if [ $? -ne 0 ]; then 52 fail "import public key ($v/$t) failed" 53 continue 54 fi 55 ${SSHKEYGEN} -if ${COMPRV} > ${OPENSSHPRV} 56 if [ $? -ne 0 ]; then 57 fail "import private key ($v/$t) failed" 58 continue 59 fi 60 chmod 600 ${OPENSSHPRV} 61 ${SSHKEYGEN} -yf ${OPENSSHPRV} |\ 62 diff - ${OPENSSHPUB} 63 if [ $? -ne 0 ]; then 64 fail "public keys ($v/$t) differ" 65 fi 66 done 67done 68 69rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB 70