testfipsssl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/sh
  2. if [ "$1" = "" ]; then
  3. key=../apps/server.pem
  4. else
  5. key="$1"
  6. fi
  7. if [ "$2" = "" ]; then
  8. cert=../apps/server.pem
  9. else
  10. cert="$2"
  11. fi
  12. ciphers="DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:EXP1024-DHE-DSS-DES-CBC-SHA:EXP1024-DES-CBC-SHA:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA"
  13. ssltest="../util/shlib_wrap.sh ./ssltest -F -key $key -cert $cert -c_key $key -c_cert $cert -cipher $ciphers"
  14. if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
  15. dsa_cert=YES
  16. else
  17. dsa_cert=NO
  18. fi
  19. if [ "$3" = "" ]; then
  20. CA="-CApath ../certs"
  21. else
  22. CA="-CAfile $3"
  23. fi
  24. if [ "$4" = "" ]; then
  25. extra=""
  26. else
  27. extra="$4"
  28. fi
  29. #############################################################################
  30. echo test ssl3 is forbidden in FIPS mode
  31. $ssltest -ssl3 $extra && exit 1
  32. if ../util/shlib_wrap.sh ../apps/openssl ciphers SSLv2 >/dev/null 2>&1; then
  33. echo test ssl2 is forbidden in FIPS mode
  34. $ssltest -ssl2 $extra && exit 1
  35. else
  36. echo ssl2 disabled: skipping test
  37. fi
  38. echo test tls1
  39. $ssltest -tls1 $extra || exit 1
  40. echo test tls1 with server authentication
  41. $ssltest -tls1 -server_auth $CA $extra || exit 1
  42. echo test tls1 with client authentication
  43. $ssltest -tls1 -client_auth $CA $extra || exit 1
  44. echo test tls1 with both client and server authentication
  45. $ssltest -tls1 -server_auth -client_auth $CA $extra || exit 1
  46. echo test tls1 via BIO pair
  47. $ssltest -bio_pair -tls1 $extra || exit 1
  48. echo test tls1 with server authentication via BIO pair
  49. $ssltest -bio_pair -tls1 -server_auth $CA $extra || exit 1
  50. echo test tls1 with client authentication via BIO pair
  51. $ssltest -bio_pair -tls1 -client_auth $CA $extra || exit 1
  52. echo test tls1 with both client and server authentication via BIO pair
  53. $ssltest -bio_pair -tls1 -server_auth -client_auth $CA $extra || exit 1
  54. # note that all the below actually choose TLS...
  55. if [ $dsa_cert = NO ]; then
  56. echo test sslv2/sslv3 w/o DHE via BIO pair
  57. $ssltest -bio_pair -no_dhe $extra || exit 1
  58. fi
  59. echo test sslv2/sslv3 with 1024bit DHE via BIO pair
  60. $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
  61. echo test sslv2/sslv3 with server authentication
  62. $ssltest -bio_pair -server_auth $CA $extra || exit 1
  63. echo test sslv2/sslv3 with client authentication via BIO pair
  64. $ssltest -bio_pair -client_auth $CA $extra || exit 1
  65. echo test sslv2/sslv3 with both client and server authentication via BIO pair
  66. $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
  67. echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
  68. $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
  69. #############################################################################
  70. if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
  71. echo skipping anonymous DH tests
  72. else
  73. echo test tls1 with 1024bit anonymous DH, multiple handshakes
  74. $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
  75. fi
  76. if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
  77. echo skipping RSA tests
  78. else
  79. echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
  80. ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
  81. if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
  82. echo skipping RSA+DHE tests
  83. else
  84. echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
  85. ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
  86. fi
  87. fi
  88. exit 0