- (djm) [openbsd-compat/port-linux.c] Check whether SELinux is enabled
[openssh-git.git] / regress / ssh-com-keygen.sh
blob29b02d94617f7956e357c28c5979597dec3c6828
1 # $OpenBSD: ssh-com-keygen.sh,v 1.4 2004/02/24 17:06:52 markus Exp $
2 # Placed in the Public Domain.
4 tid="ssh.com key import"
6 #TEST_COMBASE=/path/to/ssh/com/binaries
7 if [ "X${TEST_COMBASE}" = "X" ]; then
8 fatal '$TEST_COMBASE is not set'
9 fi
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.2.2
24 3.2.3
25 3.2.5
26 3.2.9
27 3.2.9.1
28 3.3.0"
30 COMPRV=${OBJ}/comkey
31 COMPUB=${COMPRV}.pub
32 OPENSSHPRV=${OBJ}/opensshkey
33 OPENSSHPUB=${OPENSSHPRV}.pub
35 # go for it
36 for v in ${VERSIONS}; do
37 keygen=${TEST_COMBASE}/${v}/ssh-keygen2
38 if [ ! -x ${keygen} ]; then
39 continue
41 types="dss"
42 case $v in
43 2.3.1|3.*)
44 types="$types rsa"
46 esac
47 for t in $types; do
48 verbose "ssh-keygen $v/$t"
49 rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB
50 ${keygen} -q -P -t $t ${COMPRV} > /dev/null 2>&1
51 if [ $? -ne 0 ]; then
52 fail "${keygen} -t $t failed"
53 continue
55 ${SSHKEYGEN} -if ${COMPUB} > ${OPENSSHPUB}
56 if [ $? -ne 0 ]; then
57 fail "import public key ($v/$t) failed"
58 continue
60 ${SSHKEYGEN} -if ${COMPRV} > ${OPENSSHPRV}
61 if [ $? -ne 0 ]; then
62 fail "import private key ($v/$t) failed"
63 continue
65 chmod 600 ${OPENSSHPRV}
66 ${SSHKEYGEN} -yf ${OPENSSHPRV} |\
67 diff - ${OPENSSHPUB}
68 if [ $? -ne 0 ]; then
69 fail "public keys ($v/$t) differ"
71 done
72 done
74 rm -f $COMPRV $COMPUB $OPENSSHPRV $OPENSSHPUB