trsa 2.0 KB
Newer Older
1 2
#!/bin/sh

3
if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
4
  echo skipping rsa conversion test
5 6 7
  exit 0
fi

8
cmd='../util/shlib_wrap.sh ../apps/openssl rsa'
9 10 11 12 13 14 15 16

if [ "$1"x != "x" ]; then
	t=$1
else
	t=testrsa.pem
fi

echo testing rsa conversions
B
Ben Laurie 已提交
17
cp $t rsa-fff.p
18 19

echo "p -> d"
B
Ben Laurie 已提交
20
$cmd -in rsa-fff.p -inform p -outform d >rsa-f.d
21 22
if [ $? != 0 ]; then exit 1; fi
#echo "p -> t"
B
Ben Laurie 已提交
23
#$cmd -in rsa-fff.p -inform p -outform t >rsa-f.t
24 25
#if [ $? != 0 ]; then exit 1; fi
echo "p -> p"
B
Ben Laurie 已提交
26
$cmd -in rsa-fff.p -inform p -outform p >rsa-f.p
27 28 29
if [ $? != 0 ]; then exit 1; fi

echo "d -> d"
B
Ben Laurie 已提交
30
$cmd -in rsa-f.d -inform d -outform d >rsa-ff.d1
31 32
if [ $? != 0 ]; then exit 1; fi
#echo "t -> d"
B
Ben Laurie 已提交
33
#$cmd -in rsa-f.t -inform t -outform d >rsa-ff.d2
34 35
#if [ $? != 0 ]; then exit 1; fi
echo "p -> d"
B
Ben Laurie 已提交
36
$cmd -in rsa-f.p -inform p -outform d >rsa-ff.d3
37 38 39
if [ $? != 0 ]; then exit 1; fi

#echo "d -> t"
B
Ben Laurie 已提交
40
#$cmd -in rsa-f.d -inform d -outform t >rsa-ff.t1
41 42
#if [ $? != 0 ]; then exit 1; fi
#echo "t -> t"
B
Ben Laurie 已提交
43
#$cmd -in rsa-f.t -inform t -outform t >rsa-ff.t2
44 45
#if [ $? != 0 ]; then exit 1; fi
#echo "p -> t"
B
Ben Laurie 已提交
46
#$cmd -in rsa-f.p -inform p -outform t >rsa-ff.t3
47 48 49
#if [ $? != 0 ]; then exit 1; fi

echo "d -> p"
B
Ben Laurie 已提交
50
$cmd -in rsa-f.d -inform d -outform p >rsa-ff.p1
51 52
if [ $? != 0 ]; then exit 1; fi
#echo "t -> p"
B
Ben Laurie 已提交
53
#$cmd -in rsa-f.t -inform t -outform p >rsa-ff.p2
54 55
#if [ $? != 0 ]; then exit 1; fi
echo "p -> p"
B
Ben Laurie 已提交
56
$cmd -in rsa-f.p -inform p -outform p >rsa-ff.p3
57 58
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
59
cmp rsa-fff.p rsa-f.p
60
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
61
cmp rsa-fff.p rsa-ff.p1
62
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
63
#cmp rsa-fff.p rsa-ff.p2
64
#if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
65
cmp rsa-fff.p rsa-ff.p3
66 67
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
68
#cmp rsa-f.t rsa-ff.t1
69
#if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
70
#cmp rsa-f.t rsa-ff.t2
71
#if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
72
#cmp rsa-f.t rsa-ff.t3
73 74
#if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
75
cmp rsa-f.p rsa-ff.p1
76
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
77
#cmp rsa-f.p rsa-ff.p2
78
#if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
79
cmp rsa-f.p rsa-ff.p3
80 81
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
82
/bin/rm -f rsa-f.* rsa-ff.* rsa-fff.*
83
exit 0