tx509 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/sh
  2. if test "$OSTYPE" = msdosdjgpp; then
  3. PATH=../apps\;$PATH
  4. else
  5. PATH=../apps:$PATH
  6. fi
  7. export PATH
  8. cmd='../apps/openssl x509'
  9. if [ "$1"x != "x" ]; then
  10. t=$1
  11. else
  12. t=testx509.pem
  13. fi
  14. echo testing X509 conversions
  15. cp $t fff.p
  16. echo "p -> d"
  17. $cmd -in fff.p -inform p -outform d >f.d
  18. if [ $? != 0 ]; then exit 1; fi
  19. echo "p -> n"
  20. $cmd -in fff.p -inform p -outform n >f.n
  21. if [ $? != 0 ]; then exit 1; fi
  22. echo "p -> p"
  23. $cmd -in fff.p -inform p -outform p >f.p
  24. if [ $? != 0 ]; then exit 1; fi
  25. echo "d -> d"
  26. $cmd -in f.d -inform d -outform d >ff.d1
  27. if [ $? != 0 ]; then exit 1; fi
  28. echo "n -> d"
  29. $cmd -in f.n -inform n -outform d >ff.d2
  30. if [ $? != 0 ]; then exit 1; fi
  31. echo "p -> d"
  32. $cmd -in f.p -inform p -outform d >ff.d3
  33. if [ $? != 0 ]; then exit 1; fi
  34. echo "d -> n"
  35. $cmd -in f.d -inform d -outform n >ff.n1
  36. if [ $? != 0 ]; then exit 1; fi
  37. echo "n -> n"
  38. $cmd -in f.n -inform n -outform n >ff.n2
  39. if [ $? != 0 ]; then exit 1; fi
  40. echo "p -> n"
  41. $cmd -in f.p -inform p -outform n >ff.n3
  42. if [ $? != 0 ]; then exit 1; fi
  43. echo "d -> p"
  44. $cmd -in f.d -inform d -outform p >ff.p1
  45. if [ $? != 0 ]; then exit 1; fi
  46. echo "n -> p"
  47. $cmd -in f.n -inform n -outform p >ff.p2
  48. if [ $? != 0 ]; then exit 1; fi
  49. echo "p -> p"
  50. $cmd -in f.p -inform p -outform p >ff.p3
  51. if [ $? != 0 ]; then exit 1; fi
  52. cmp fff.p f.p
  53. if [ $? != 0 ]; then exit 1; fi
  54. cmp fff.p ff.p1
  55. if [ $? != 0 ]; then exit 1; fi
  56. cmp fff.p ff.p2
  57. if [ $? != 0 ]; then exit 1; fi
  58. cmp fff.p ff.p3
  59. if [ $? != 0 ]; then exit 1; fi
  60. cmp f.n ff.n1
  61. if [ $? != 0 ]; then exit 1; fi
  62. cmp f.n ff.n2
  63. if [ $? != 0 ]; then exit 1; fi
  64. cmp f.n ff.n3
  65. if [ $? != 0 ]; then exit 1; fi
  66. cmp f.p ff.p1
  67. if [ $? != 0 ]; then exit 1; fi
  68. cmp f.p ff.p2
  69. if [ $? != 0 ]; then exit 1; fi
  70. cmp f.p ff.p3
  71. if [ $? != 0 ]; then exit 1; fi
  72. /bin/rm -f f.* ff.* fff.*
  73. exit 0