summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/testenc.sh
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>1999-03-26 18:24:03 +0000
committercvs2svn <admin@example.com>1999-03-26 18:24:03 +0000
commit3fc228fb4c1a39aceaee3d7013365042a6077bd0 (patch)
treeaf769f6648929b3b2c1f9e053a3754fa989ce302 /src/regress/lib/libssl/testenc.sh
parent536c76cbb863bab152f19842ab88772c01e922c7 (diff)
downloadopenbsd-OPENBSD_2_5.tar.gz
openbsd-OPENBSD_2_5.tar.bz2
openbsd-OPENBSD_2_5.zip
This commit was manufactured by cvs2git to create branch 'OPENBSD_2_5'.OPENBSD_2_5
Diffstat (limited to '')
-rw-r--r--src/regress/lib/libssl/testenc.sh63
1 files changed, 63 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..85997bfbe5
--- /dev/null
+++ b/src/regress/lib/libssl/testenc.sh
@@ -0,0 +1,63 @@
1#!/bin/sh
2
3testsrc=$2/ssleay.cnf
4test=$1/p
5cmd=/usr/sbin/ssleay
6
7cd $1
8
9cat $testsrc >$test;
10
11echo cat
12$cmd enc < $test > $test.cipher
13$cmd enc < $test.cipher >$test.clear
14cmp $test $test.clear
15if [ $? != 0 ]
16then
17 exit 1
18else
19 /bin/rm $test.cipher $test.clear
20fi
21echo base64
22$cmd enc -a -e < $test > $test.cipher
23$cmd enc -a -d < $test.cipher >$test.clear
24cmp $test $test.clear
25if [ $? != 0 ]
26then
27 exit 1
28else
29 /bin/rm $test.cipher $test.clear
30fi
31
32for i in rc4 \
33 des-cfb des-ede-cfb des-ede3-cfb \
34 des-ofb des-ede-ofb des-ede3-ofb \
35 des-ecb des-ede des-ede3 desx \
36 des-cbc des-ede-cbc des-ede3-cbc \
37 rc2-ecb rc2-cfb rc2-ofb rc2-cbc \
38 bf-ecb bf-cfb bf-ofb bf-cbc rc4 \
39 cast5-ecb cast5-cfb cast5-ofb cast5-cbc
40do
41 echo $i
42 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
43 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
44 cmp $test $test.$i.clear
45 if [ $? != 0 ]
46 then
47 exit 1
48 else
49 /bin/rm $test.$i.cipher $test.$i.clear
50 fi
51
52 echo $i base64
53 $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
54 $cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
55 cmp $test $test.$i.clear
56 if [ $? != 0 ]
57 then
58 exit 1
59 else
60 /bin/rm $test.$i.cipher $test.$i.clear
61 fi
62done
63rm -f $test