summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/testenc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libssl/testenc.sh')
-rw-r--r--src/regress/lib/libssl/testenc.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/regress/lib/libssl/testenc.sh b/src/regress/lib/libssl/testenc.sh
new file mode 100644
index 0000000000..ab3278f27e
--- /dev/null
+++ b/src/regress/lib/libssl/testenc.sh
@@ -0,0 +1,61 @@
1#!/bin/sh
2
3testsrc=./ssleay.cnf
4test=./p
5cmd=/usr/sbin/ssleay
6
7cat $testsrc >$test;
8
9echo cat
10$cmd enc < $test > $test.cipher
11$cmd enc < $test.cipher >$test.clear
12cmp $test $test.clear
13if [ $? != 0 ]
14then
15 exit 1
16else
17 /bin/rm $test.cipher $test.clear
18fi
19echo base64
20$cmd enc -a -e < $test > $test.cipher
21$cmd enc -a -d < $test.cipher >$test.clear
22cmp $test $test.clear
23if [ $? != 0 ]
24then
25 exit 1
26else
27 /bin/rm $test.cipher $test.clear
28fi
29
30for i in rc4 \
31 des-cfb des-ede-cfb des-ede3-cfb \
32 des-ofb des-ede-ofb des-ede3-ofb \
33 des-ecb des-ede des-ede3 desx \
34 des-cbc des-ede-cbc des-ede3-cbc \
35 rc2-ecb rc2-cfb rc2-ofb rc2-cbc \
36 bf-ecb bf-cfb bf-ofb bf-cbc rc4 \
37 cast5-ecb cast5-cfb cast5-ofb cast5-cbc
38do
39 echo $i
40 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
41 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
42 cmp $test $test.$i.clear
43 if [ $? != 0 ]
44 then
45 exit 1
46 else
47 /bin/rm $test.$i.cipher $test.$i.clear
48 fi
49
50 echo $i base64
51 $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
52 $cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
53 cmp $test $test.$i.clear
54 if [ $? != 0 ]
55 then
56 exit 1
57 else
58 /bin/rm $test.$i.cipher $test.$i.clear
59 fi
60done
61rm -f $test