Small bugs in the test scripts removed.
[openssl.git] / test / trsa
1 #!/bin/sh
2
3 PATH=../apps:$PATH
4 export PATH
5
6 if ../apps/openssl no-rsa; then
7   echo skipping rsa conversion test
8   exit 0
9 fi
10
11 cmd='../apps/openssl rsa'
12
13 if [ "$1"x != "x" ]; then
14         t=$1
15 else
16         t=testrsa.pem
17 fi
18
19 echo testing rsa conversions
20 cp $t fff.p
21
22 echo "p -> d"
23 $cmd -in fff.p -inform p -outform d >f.d
24 if [ $? != 0 ]; then exit 1; fi
25 #echo "p -> t"
26 #$cmd -in fff.p -inform p -outform t >f.t
27 #if [ $? != 0 ]; then exit 1; fi
28 echo "p -> p"
29 $cmd -in fff.p -inform p -outform p >f.p
30 if [ $? != 0 ]; then exit 1; fi
31
32 echo "d -> d"
33 $cmd -in f.d -inform d -outform d >ff.d1
34 if [ $? != 0 ]; then exit 1; fi
35 #echo "t -> d"
36 #$cmd -in f.t -inform t -outform d >ff.d2
37 #if [ $? != 0 ]; then exit 1; fi
38 echo "p -> d"
39 $cmd -in f.p -inform p -outform d >ff.d3
40 if [ $? != 0 ]; then exit 1; fi
41
42 #echo "d -> t"
43 #$cmd -in f.d -inform d -outform t >ff.t1
44 #if [ $? != 0 ]; then exit 1; fi
45 #echo "t -> t"
46 #$cmd -in f.t -inform t -outform t >ff.t2
47 #if [ $? != 0 ]; then exit 1; fi
48 #echo "p -> t"
49 #$cmd -in f.p -inform p -outform t >ff.t3
50 #if [ $? != 0 ]; then exit 1; fi
51
52 echo "d -> p"
53 $cmd -in f.d -inform d -outform p >ff.p1
54 if [ $? != 0 ]; then exit 1; fi
55 #echo "t -> p"
56 #$cmd -in f.t -inform t -outform p >ff.p2
57 #if [ $? != 0 ]; then exit 1; fi
58 echo "p -> p"
59 $cmd -in f.p -inform p -outform p >ff.p3
60 if [ $? != 0 ]; then exit 1; fi
61
62 cmp fff.p f.p
63 if [ $? != 0 ]; then exit 1; fi
64 cmp fff.p ff.p1
65 if [ $? != 0 ]; then exit 1; fi
66 #cmp fff.p ff.p2
67 #if [ $? != 0 ]; then exit 1; fi
68 cmp fff.p ff.p3
69 if [ $? != 0 ]; then exit 1; fi
70
71 #cmp f.t ff.t1
72 #if [ $? != 0 ]; then exit 1; fi
73 #cmp f.t ff.t2
74 #if [ $? != 0 ]; then exit 1; fi
75 #cmp f.t ff.t3
76 #if [ $? != 0 ]; then exit 1; fi
77
78 cmp f.p ff.p1
79 if [ $? != 0 ]; then exit 1; fi
80 #cmp f.p ff.p2
81 #if [ $? != 0 ]; then exit 1; fi
82 cmp f.p ff.p3
83 if [ $? != 0 ]; then exit 1; fi
84
85 /bin/rm -f f.* ff.* fff.*
86 exit 0