treq 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. cmd='../util/shlib_wrap.sh ../apps/openssl req -config ../apps/openssl.cnf'
  3. if [ "$1"x != "x" ]; then
  4. t=$1
  5. else
  6. t=testreq.pem
  7. fi
  8. if $cmd -in $t -inform p -noout -text 2>&1 | fgrep -i 'Unknown Public Key'; then
  9. echo "skipping req conversion test for $t"
  10. exit 0
  11. fi
  12. echo testing req conversions
  13. cp $t req-fff.p
  14. echo "p -> d"
  15. $cmd -in req-fff.p -inform p -outform d >req-f.d || exit 1
  16. echo "p -> p"
  17. $cmd -in req-fff.p -inform p -outform p >req-f.p || exit 1
  18. echo "d -> d"
  19. $cmd -verify -in req-f.d -inform d -outform d >req-ff.d1 || exit 1
  20. echo "p -> d"
  21. $cmd -verify -in req-f.p -inform p -outform d >req-ff.d3 || exit 1
  22. echo "d -> p"
  23. $cmd -in req-f.d -inform d -outform p >req-ff.p1 || exit 1
  24. echo "p -> p"
  25. $cmd -in req-f.p -inform p -outform p >req-ff.p3 || exit 1
  26. cmp req-fff.p req-f.p || exit 1
  27. cmp req-fff.p req-ff.p1 || exit 1
  28. cmp req-fff.p req-ff.p3 || exit 1
  29. cmp req-f.p req-ff.p1 || exit 1
  30. cmp req-f.p req-ff.p3 || exit 1
  31. /bin/rm -f req-f.* req-ff.* req-fff.*
  32. exit 0