diff options
Diffstat (limited to '')
-rw-r--r-- | src/regress/lib/libssl/testenc.sh | 63 |
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 | |||
3 | testsrc=$2/ssleay.cnf | ||
4 | test=$1/p | ||
5 | cmd=/usr/sbin/ssleay | ||
6 | |||
7 | cd $1 | ||
8 | |||
9 | cat $testsrc >$test; | ||
10 | |||
11 | echo cat | ||
12 | $cmd enc < $test > $test.cipher | ||
13 | $cmd enc < $test.cipher >$test.clear | ||
14 | cmp $test $test.clear | ||
15 | if [ $? != 0 ] | ||
16 | then | ||
17 | exit 1 | ||
18 | else | ||
19 | /bin/rm $test.cipher $test.clear | ||
20 | fi | ||
21 | echo base64 | ||
22 | $cmd enc -a -e < $test > $test.cipher | ||
23 | $cmd enc -a -d < $test.cipher >$test.clear | ||
24 | cmp $test $test.clear | ||
25 | if [ $? != 0 ] | ||
26 | then | ||
27 | exit 1 | ||
28 | else | ||
29 | /bin/rm $test.cipher $test.clear | ||
30 | fi | ||
31 | |||
32 | for 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 | ||
40 | do | ||
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 | ||
62 | done | ||
63 | rm -f $test | ||