tx509 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 x509-fff.p
  10. echo "p -> d"
  11. $cmd -in x509-fff.p -inform p -outform d >x509-f.d
  12. if [ $? != 0 ]; then exit 1; fi
  13. echo "p -> n"
  14. $cmd -in x509-fff.p -inform p -outform n >x509-f.n
  15. if [ $? != 0 ]; then exit 1; fi
  16. echo "p -> p"
  17. $cmd -in x509-fff.p -inform p -outform p >x509-f.p
  18. if [ $? != 0 ]; then exit 1; fi
  19. echo "d -> d"
  20. $cmd -in x509-f.d -inform d -outform d >x509-ff.d1
  21. if [ $? != 0 ]; then exit 1; fi
  22. echo "n -> d"
  23. $cmd -in x509-f.n -inform n -outform d >x509-ff.d2
  24. if [ $? != 0 ]; then exit 1; fi
  25. echo "p -> d"
  26. $cmd -in x509-f.p -inform p -outform d >x509-ff.d3
  27. if [ $? != 0 ]; then exit 1; fi
  28. echo "d -> n"
  29. $cmd -in x509-f.d -inform d -outform n >x509-ff.n1
  30. if [ $? != 0 ]; then exit 1; fi
  31. echo "n -> n"
  32. $cmd -in x509-f.n -inform n -outform n >x509-ff.n2
  33. if [ $? != 0 ]; then exit 1; fi
  34. echo "p -> n"
  35. $cmd -in x509-f.p -inform p -outform n >x509-ff.n3
  36. if [ $? != 0 ]; then exit 1; fi
  37. echo "d -> p"
  38. $cmd -in x509-f.d -inform d -outform p >x509-ff.p1
  39. if [ $? != 0 ]; then exit 1; fi
  40. echo "n -> p"
  41. $cmd -in x509-f.n -inform n -outform p >x509-ff.p2
  42. if [ $? != 0 ]; then exit 1; fi
  43. echo "p -> p"
  44. $cmd -in x509-f.p -inform p -outform p >x509-ff.p3
  45. if [ $? != 0 ]; then exit 1; fi
  46. cmp x509-fff.p x509-f.p
  47. if [ $? != 0 ]; then exit 1; fi
  48. cmp x509-fff.p x509-ff.p1
  49. if [ $? != 0 ]; then exit 1; fi
  50. cmp x509-fff.p x509-ff.p2
  51. if [ $? != 0 ]; then exit 1; fi
  52. cmp x509-fff.p x509-ff.p3
  53. if [ $? != 0 ]; then exit 1; fi
  54. cmp x509-f.n x509-ff.n1
  55. if [ $? != 0 ]; then exit 1; fi
  56. cmp x509-f.n x509-ff.n2
  57. if [ $? != 0 ]; then exit 1; fi
  58. cmp x509-f.n x509-ff.n3
  59. if [ $? != 0 ]; then exit 1; fi
  60. cmp x509-f.p x509-ff.p1
  61. if [ $? != 0 ]; then exit 1; fi
  62. cmp x509-f.p x509-ff.p2
  63. if [ $? != 0 ]; then exit 1; fi
  64. cmp x509-f.p x509-ff.p3
  65. if [ $? != 0 ]; then exit 1; fi
  66. echo "Parsing test certificates"
  67. $cmd -in certs/pss1.pem -text -noout >/dev/null
  68. if [ $? != 0 ]; then exit 1; fi
  69. echo OK
  70. /bin/rm -f x509-f.* x509-ff.* x509-fff.*
  71. exit 0