trsa 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. if ../apps/openssl no-rsa; then
  9. echo skipping rsa conversion test
  10. exit 0
  11. fi
  12. cmd='../apps/openssl rsa'
  13. if [ "$1"x != "x" ]; then
  14. t=$1
  15. else
  16. t=testrsa.pem
  17. fi
  18. echo testing rsa conversions
  19. cp $t fff.p
  20. echo "p -> d"
  21. $cmd -in fff.p -inform p -outform d >f.d
  22. if [ $? != 0 ]; then exit 1; fi
  23. #echo "p -> t"
  24. #$cmd -in fff.p -inform p -outform t >f.t
  25. #if [ $? != 0 ]; then exit 1; fi
  26. echo "p -> p"
  27. $cmd -in fff.p -inform p -outform p >f.p
  28. if [ $? != 0 ]; then exit 1; fi
  29. echo "d -> d"
  30. $cmd -in f.d -inform d -outform d >ff.d1
  31. if [ $? != 0 ]; then exit 1; fi
  32. #echo "t -> d"
  33. #$cmd -in f.t -inform t -outform d >ff.d2
  34. #if [ $? != 0 ]; then exit 1; fi
  35. echo "p -> d"
  36. $cmd -in f.p -inform p -outform d >ff.d3
  37. if [ $? != 0 ]; then exit 1; fi
  38. #echo "d -> t"
  39. #$cmd -in f.d -inform d -outform t >ff.t1
  40. #if [ $? != 0 ]; then exit 1; fi
  41. #echo "t -> t"
  42. #$cmd -in f.t -inform t -outform t >ff.t2
  43. #if [ $? != 0 ]; then exit 1; fi
  44. #echo "p -> t"
  45. #$cmd -in f.p -inform p -outform t >ff.t3
  46. #if [ $? != 0 ]; then exit 1; fi
  47. echo "d -> p"
  48. $cmd -in f.d -inform d -outform p >ff.p1
  49. if [ $? != 0 ]; then exit 1; fi
  50. #echo "t -> p"
  51. #$cmd -in f.t -inform t -outform p >ff.p2
  52. #if [ $? != 0 ]; then exit 1; fi
  53. echo "p -> p"
  54. $cmd -in f.p -inform p -outform p >ff.p3
  55. if [ $? != 0 ]; then exit 1; fi
  56. cmp fff.p f.p
  57. if [ $? != 0 ]; then exit 1; fi
  58. cmp fff.p ff.p1
  59. if [ $? != 0 ]; then exit 1; fi
  60. #cmp fff.p ff.p2
  61. #if [ $? != 0 ]; then exit 1; fi
  62. cmp fff.p ff.p3
  63. if [ $? != 0 ]; then exit 1; fi
  64. #cmp f.t ff.t1
  65. #if [ $? != 0 ]; then exit 1; fi
  66. #cmp f.t ff.t2
  67. #if [ $? != 0 ]; then exit 1; fi
  68. #cmp f.t ff.t3
  69. #if [ $? != 0 ]; then exit 1; fi
  70. cmp f.p ff.p1
  71. if [ $? != 0 ]; then exit 1; fi
  72. #cmp f.p ff.p2
  73. #if [ $? != 0 ]; then exit 1; fi
  74. cmp f.p ff.p3
  75. if [ $? != 0 ]; then exit 1; fi
  76. /bin/rm -f f.* ff.* fff.*
  77. exit 0