Tomato 1.28
[tomato.git] / release / src / router / openssl / test / treq
blob9f5eb7eea502d7e8df368e1ca7c50677a4c6fb1e
1 #!/bin/sh
3 PATH=../apps:$PATH
4 export PATH
6 cmd='../apps/openssl req -config ../apps/openssl.cnf'
8 if [ "$1"x != "x" ]; then
9 t=$1
10 else
11 t=testreq.pem
14 if $cmd -in $t -inform p -noout -text | fgrep 'Unknown Public Key'; then
15 echo "skipping req conversion test for $t"
16 exit 0
19 echo testing req conversions
20 cp $t fff.p
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
32 echo "d -> d"
33 $cmd -verify -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 -verify -in f.p -inform p -outform d >ff.d3
40 if [ $? != 0 ]; then exit 1; fi
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
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
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
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
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
85 /bin/rm -f f.* ff.* fff.*
86 exit 0