GH365: Missing #ifdef rename.
[openssl.git] / test / testenc
index 7bcf3d145c17edaca2793aa0e51a0f38d021cb65..941a302ff7c843c10f4ed8117235c72cb9291978 100644 (file)
@@ -1,61 +1,36 @@
 #!/bin/sh
 
-testsrc=Makefile.ssl
+testsrc=testenc
 test=./p
-cmd=../apps/ssleay
+
+cmd="../util/shlib_wrap.sh ../apps/openssl"
 
 cat $testsrc >$test;
 
 echo cat
 $cmd enc < $test > $test.cipher
 $cmd enc < $test.cipher >$test.clear
-cmp $test $test.clear
-if [ $? != 0 ]
-then
-       exit 1
-else
-       /bin/rm $test.cipher $test.clear
-fi
+cmp $test $test.clear || exit 1
+/bin/rm $test.cipher $test.clear
+
 echo base64
 $cmd enc -a -e < $test > $test.cipher
 $cmd enc -a -d < $test.cipher >$test.clear
-cmp $test $test.clear
-if [ $? != 0 ]
-then
-       exit 1
-else
-       /bin/rm $test.cipher $test.clear
-fi
+cmp $test $test.clear || exit 1
+/bin/rm $test.cipher $test.clear
 
-for i in rc4 \
-       des-cfb des-ede-cfb des-ede3-cfb \
-       des-ofb des-ede-ofb des-ede3-ofb \
-       des-ecb des-ede des-ede3 desx \
-       des-cbc des-ede-cbc des-ede3-cbc \
-       idea-ecb idea-cfb idea-ofb idea-cbc \
-       rc2-ecb rc2-cfb rc2-ofb rc2-cbc \
-       bf-ecb bf-cfb bf-ofb bf-cbc
+for i in `$cmd list -cipher-commands`
 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
-       cmp $test $test.$i.clear
-       if [ $? != 0 ]
-       then
-               exit 1
-       else
-               /bin/rm $test.$i.cipher $test.$i.clear
-       fi
+       cmp $test $test.$i.clear || exit 1
+       /bin/rm $test.$i.cipher $test.$i.clear
 
        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
-       cmp $test $test.$i.clear
-       if [ $? != 0 ]
-       then
-               exit 1
-       else
-               /bin/rm $test.$i.cipher $test.$i.clear
-       fi
+       cmp $test $test.$i.clear || exit 1
+       /bin/rm $test.$i.cipher $test.$i.clear
 done
 rm -f $test