]> andersk Git - gssapi-openssh.git/blob - openssh/regress/ssh-com-keygen.sh
e93dc78c9a8ac5f482548d57d7fd1cef470945a6
[gssapi-openssh.git] / openssh / regress / ssh-com-keygen.sh
1 #       $OpenBSD: ssh-com-keygen.sh,v 1.2 2002/07/16 08:58:16 markus Exp $
2 #       Placed in the Public Domain.
3
4 tid="ssh.com key import"
5
6 #TEST_COMBASE=/path/to/ssh/com/binaries
7 if [ "X${TEST_COMBASE}" = "X" ]; then
8         fatal '$TEST_COMBASE is not set'
9 fi
10
11 VERSIONS="
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
25 COMPRV=${OBJ}/comkey
26 COMPUB=${COMPRV}.pub
27 OPENSSHPRV=${OBJ}/opensshkey
28 OPENSSHPUB=${OPENSSHPRV}.pub
29
30 # go for it
31 for 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
67 done
68
69 rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB
This page took 0.033107 seconds and 3 git commands to generate.