tx509 1.9 KB
Newer Older
1 2
#!/bin/sh

3
cmd='../util/shlib_wrap.sh ../apps/openssl x509'
4 5 6 7 8 9 10 11

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

echo testing X509 conversions
B
Ben Laurie 已提交
12
cp $t x509-fff.p
13 14

echo "p -> d"
B
Ben Laurie 已提交
15
$cmd -in x509-fff.p -inform p -outform d >x509-f.d
16 17
if [ $? != 0 ]; then exit 1; fi
echo "p -> n"
B
Ben Laurie 已提交
18
$cmd -in x509-fff.p -inform p -outform n >x509-f.n
19 20
if [ $? != 0 ]; then exit 1; fi
echo "p -> p"
B
Ben Laurie 已提交
21
$cmd -in x509-fff.p -inform p -outform p >x509-f.p
22 23 24
if [ $? != 0 ]; then exit 1; fi

echo "d -> d"
B
Ben Laurie 已提交
25
$cmd -in x509-f.d -inform d -outform d >x509-ff.d1
26 27
if [ $? != 0 ]; then exit 1; fi
echo "n -> d"
B
Ben Laurie 已提交
28
$cmd -in x509-f.n -inform n -outform d >x509-ff.d2
29 30
if [ $? != 0 ]; then exit 1; fi
echo "p -> d"
B
Ben Laurie 已提交
31
$cmd -in x509-f.p -inform p -outform d >x509-ff.d3
32 33 34
if [ $? != 0 ]; then exit 1; fi

echo "d -> n"
B
Ben Laurie 已提交
35
$cmd -in x509-f.d -inform d -outform n >x509-ff.n1
36 37
if [ $? != 0 ]; then exit 1; fi
echo "n -> n"
B
Ben Laurie 已提交
38
$cmd -in x509-f.n -inform n -outform n >x509-ff.n2
39 40
if [ $? != 0 ]; then exit 1; fi
echo "p -> n"
B
Ben Laurie 已提交
41
$cmd -in x509-f.p -inform p -outform n >x509-ff.n3
42 43 44
if [ $? != 0 ]; then exit 1; fi

echo "d -> p"
B
Ben Laurie 已提交
45
$cmd -in x509-f.d -inform d -outform p >x509-ff.p1
46 47
if [ $? != 0 ]; then exit 1; fi
echo "n -> p"
B
Ben Laurie 已提交
48
$cmd -in x509-f.n -inform n -outform p >x509-ff.p2
49 50
if [ $? != 0 ]; then exit 1; fi
echo "p -> p"
B
Ben Laurie 已提交
51
$cmd -in x509-f.p -inform p -outform p >x509-ff.p3
52 53
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
54
cmp x509-fff.p x509-f.p
55
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
56
cmp x509-fff.p x509-ff.p1
57
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
58
cmp x509-fff.p x509-ff.p2
59
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
60
cmp x509-fff.p x509-ff.p3
61 62
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
63
cmp x509-f.n x509-ff.n1
64
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
65
cmp x509-f.n x509-ff.n2
66
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
67
cmp x509-f.n x509-ff.n3
68 69
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
70
cmp x509-f.p x509-ff.p1
71
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
72
cmp x509-f.p x509-ff.p2
73
if [ $? != 0 ]; then exit 1; fi
B
Ben Laurie 已提交
74
cmp x509-f.p x509-ff.p3
75 76
if [ $? != 0 ]; then exit 1; fi

B
Ben Laurie 已提交
77
/bin/rm -f x509-f.* x509-ff.* x509-fff.*
78
exit 0