trsa 2.0 KB

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