summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/testenc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/test/testenc')
-rw-r--r--src/lib/libssl/test/testenc62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/lib/libssl/test/testenc b/src/lib/libssl/test/testenc
new file mode 100644
index 0000000000..42db56c2be
--- /dev/null
+++ b/src/lib/libssl/test/testenc
@@ -0,0 +1,62 @@
1#!/bin/sh
2
3testsrc=Makefile.ssl
4test=./p
5cmd=../apps/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 idea-ecb idea-cfb idea-ofb idea-cbc \
36 rc2-ecb rc2-cfb rc2-ofb rc2-cbc \
37 bf-ecb bf-cfb bf-ofb bf-cbc rc4 \
38 cast5-ecb cast5-cfb cast5-ofb cast5-cbc
39do
40 echo $i
41 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
42 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
43 cmp $test $test.$i.clear
44 if [ $? != 0 ]
45 then
46 exit 1
47 else
48 /bin/rm $test.$i.cipher $test.$i.clear
49 fi
50
51 echo $i base64
52 $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
53 $cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
54 cmp $test $test.$i.clear
55 if [ $? != 0 ]
56 then
57 exit 1
58 else
59 /bin/rm $test.$i.cipher $test.$i.clear
60 fi
61done
62rm -f $test