treq 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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
  16. if [ $? != 0 ]; then exit 1; fi
  17. #echo "p -> t"
  18. #$cmd -in req-fff.p -inform p -outform t >req-f.t
  19. #if [ $? != 0 ]; then exit 1; fi
  20. echo "p -> p"
  21. $cmd -in req-fff.p -inform p -outform p >req-f.p
  22. if [ $? != 0 ]; then exit 1; fi
  23. echo "d -> d"
  24. $cmd -verify -in req-f.d -inform d -outform d >req-ff.d1
  25. if [ $? != 0 ]; then exit 1; fi
  26. #echo "t -> d"
  27. #$cmd -in req-f.t -inform t -outform d >req-ff.d2
  28. #if [ $? != 0 ]; then exit 1; fi
  29. echo "p -> d"
  30. $cmd -verify -in req-f.p -inform p -outform d >req-ff.d3
  31. if [ $? != 0 ]; then exit 1; fi
  32. #echo "d -> t"
  33. #$cmd -in req-f.d -inform d -outform t >req-ff.t1
  34. #if [ $? != 0 ]; then exit 1; fi
  35. #echo "t -> t"
  36. #$cmd -in req-f.t -inform t -outform t >req-ff.t2
  37. #if [ $? != 0 ]; then exit 1; fi
  38. #echo "p -> t"
  39. #$cmd -in req-f.p -inform p -outform t >req-ff.t3
  40. #if [ $? != 0 ]; then exit 1; fi
  41. echo "d -> p"
  42. $cmd -in req-f.d -inform d -outform p >req-ff.p1
  43. if [ $? != 0 ]; then exit 1; fi
  44. #echo "t -> p"
  45. #$cmd -in req-f.t -inform t -outform p >req-ff.p2
  46. #if [ $? != 0 ]; then exit 1; fi
  47. echo "p -> p"
  48. $cmd -in req-f.p -inform p -outform p >req-ff.p3
  49. if [ $? != 0 ]; then exit 1; fi
  50. cmp req-fff.p req-f.p
  51. if [ $? != 0 ]; then exit 1; fi
  52. cmp req-fff.p req-ff.p1
  53. if [ $? != 0 ]; then exit 1; fi
  54. #cmp req-fff.p req-ff.p2
  55. #if [ $? != 0 ]; then exit 1; fi
  56. cmp req-fff.p req-ff.p3
  57. if [ $? != 0 ]; then exit 1; fi
  58. #cmp req-f.t req-ff.t1
  59. #if [ $? != 0 ]; then exit 1; fi
  60. #cmp req-f.t req-ff.t2
  61. #if [ $? != 0 ]; then exit 1; fi
  62. #cmp req-f.t req-ff.t3
  63. #if [ $? != 0 ]; then exit 1; fi
  64. cmp req-f.p req-ff.p1
  65. if [ $? != 0 ]; then exit 1; fi
  66. #cmp req-f.p req-ff.p2
  67. #if [ $? != 0 ]; then exit 1; fi
  68. cmp req-f.p req-ff.p3
  69. if [ $? != 0 ]; then exit 1; fi
  70. /bin/rm -f req-f.* req-ff.* req-fff.*
  71. exit 0