1998-12-21 18:52:47 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-04-07 23:52:54 +08:00
|
|
|
testsrc=testenc
|
1998-12-21 18:52:47 +08:00
|
|
|
test=./p
|
2015-04-09 00:28:15 +08:00
|
|
|
|
|
|
|
OPENSSL_CONF=/dev/null ; export OPENSSL_CONF
|
2005-02-02 07:48:37 +08:00
|
|
|
cmd="../util/shlib_wrap.sh ../apps/openssl"
|
1998-12-21 18:52:47 +08:00
|
|
|
|
|
|
|
cat $testsrc >$test;
|
|
|
|
|
|
|
|
echo cat
|
|
|
|
$cmd enc < $test > $test.cipher
|
|
|
|
$cmd enc < $test.cipher >$test.clear
|
2015-04-10 22:06:17 +08:00
|
|
|
cmp $test $test.clear || exit 1
|
|
|
|
/bin/rm $test.cipher $test.clear
|
|
|
|
|
1998-12-21 18:52:47 +08:00
|
|
|
echo base64
|
|
|
|
$cmd enc -a -e < $test > $test.cipher
|
|
|
|
$cmd enc -a -d < $test.cipher >$test.clear
|
2015-04-10 22:06:17 +08:00
|
|
|
cmp $test $test.clear || exit 1
|
|
|
|
/bin/rm $test.cipher $test.clear
|
1998-12-21 18:52:47 +08:00
|
|
|
|
2015-04-26 22:31:48 +08:00
|
|
|
for i in `$cmd list -cipher-commands`
|
1998-12-21 18:52:47 +08:00
|
|
|
do
|
|
|
|
echo $i
|
|
|
|
$cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
|
|
|
|
$cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
|
2015-04-10 22:06:17 +08:00
|
|
|
cmp $test $test.$i.clear || exit 1
|
|
|
|
/bin/rm $test.$i.cipher $test.$i.clear
|
1998-12-21 18:52:47 +08:00
|
|
|
|
|
|
|
echo $i base64
|
|
|
|
$cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
|
|
|
|
$cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
|
2015-04-10 22:06:17 +08:00
|
|
|
cmp $test $test.$i.clear || exit 1
|
|
|
|
/bin/rm $test.$i.cipher $test.$i.clear
|
1998-12-21 18:52:47 +08:00
|
|
|
done
|
|
|
|
rm -f $test
|