summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/treq
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/test/treq')
-rw-r--r--src/lib/libssl/test/treq86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/lib/libssl/test/treq b/src/lib/libssl/test/treq
new file mode 100644
index 0000000000..9f5eb7eea5
--- /dev/null
+++ b/src/lib/libssl/test/treq
@@ -0,0 +1,86 @@
1#!/bin/sh
2
3PATH=../apps:$PATH
4export PATH
5
6cmd='../apps/openssl req -config ../apps/openssl.cnf'
7
8if [ "$1"x != "x" ]; then
9 t=$1
10else
11 t=testreq.pem
12fi
13
14if $cmd -in $t -inform p -noout -text | fgrep 'Unknown Public Key'; then
15 echo "skipping req conversion test for $t"
16 exit 0
17fi
18
19echo testing req conversions
20cp $t fff.p
21
22echo "p -> d"
23$cmd -in fff.p -inform p -outform d >f.d
24if [ $? != 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
28echo "p -> p"
29$cmd -in fff.p -inform p -outform p >f.p
30if [ $? != 0 ]; then exit 1; fi
31
32echo "d -> d"
33$cmd -verify -in f.d -inform d -outform d >ff.d1
34if [ $? != 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
38echo "p -> d"
39$cmd -verify -in f.p -inform p -outform d >ff.d3
40if [ $? != 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
52echo "d -> p"
53$cmd -in f.d -inform d -outform p >ff.p1
54if [ $? != 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
58echo "p -> p"
59$cmd -in f.p -inform p -outform p >ff.p3
60if [ $? != 0 ]; then exit 1; fi
61
62cmp fff.p f.p
63if [ $? != 0 ]; then exit 1; fi
64cmp fff.p ff.p1
65if [ $? != 0 ]; then exit 1; fi
66#cmp fff.p ff.p2
67#if [ $? != 0 ]; then exit 1; fi
68cmp fff.p ff.p3
69if [ $? != 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
78cmp f.p ff.p1
79if [ $? != 0 ]; then exit 1; fi
80#cmp f.p ff.p2
81#if [ $? != 0 ]; then exit 1; fi
82cmp f.p ff.p3
83if [ $? != 0 ]; then exit 1; fi
84
85/bin/rm -f f.* ff.* fff.*
86exit 0