2
0

testenc 901 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. testsrc=testenc
  3. test=./p
  4. cmd="../util/shlib_wrap.sh ../apps/openssl"
  5. cat $testsrc >$test;
  6. echo cat
  7. $cmd enc < $test > $test.cipher
  8. $cmd enc < $test.cipher >$test.clear
  9. cmp $test $test.clear || exit 1
  10. /bin/rm $test.cipher $test.clear
  11. echo base64
  12. $cmd enc -a -e < $test > $test.cipher
  13. $cmd enc -a -d < $test.cipher >$test.clear
  14. cmp $test $test.clear || exit 1
  15. /bin/rm $test.cipher $test.clear
  16. for i in `$cmd list -cipher-commands`
  17. do
  18. echo $i
  19. $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
  20. $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
  21. cmp $test $test.$i.clear || exit 1
  22. /bin/rm $test.$i.cipher $test.$i.clear
  23. echo $i base64
  24. $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
  25. $cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
  26. cmp $test $test.$i.clear || exit 1
  27. /bin/rm $test.$i.cipher $test.$i.clear
  28. done
  29. rm -f $test