tx509 1.7 KB

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