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