testfipsssl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="./ssltest -F -key $key -cert $cert -c_key $key -c_cert $cert -cipher $ciphers"
  14. if ../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. echo test ssl2 is forbidden in FIPS mode
  33. $ssltest -ssl2 $extra && exit 1
  34. echo test tls1
  35. $ssltest -tls1 $extra || exit 1
  36. echo test tls1 with server authentication
  37. $ssltest -tls1 -server_auth $CA $extra || exit 1
  38. echo test tls1 with client authentication
  39. $ssltest -tls1 -client_auth $CA $extra || exit 1
  40. echo test tls1 with both client and server authentication
  41. $ssltest -tls1 -server_auth -client_auth $CA $extra || exit 1
  42. echo test tls1 via BIO pair
  43. $ssltest -bio_pair -tls1 $extra || exit 1
  44. echo test tls1 with server authentication via BIO pair
  45. $ssltest -bio_pair -tls1 -server_auth $CA $extra || exit 1
  46. echo test tls1 with client authentication via BIO pair
  47. $ssltest -bio_pair -tls1 -client_auth $CA $extra || exit 1
  48. echo test tls1 with both client and server authentication via BIO pair
  49. $ssltest -bio_pair -tls1 -server_auth -client_auth $CA $extra || exit 1
  50. # note that all the below actually choose TLS...
  51. if [ $dsa_cert = NO ]; then
  52. echo test sslv2/sslv3 w/o DHE via BIO pair
  53. $ssltest -bio_pair -no_dhe $extra || exit 1
  54. fi
  55. echo test sslv2/sslv3 with 1024bit DHE via BIO pair
  56. $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
  57. echo test sslv2/sslv3 with server authentication
  58. $ssltest -bio_pair -server_auth $CA $extra || exit 1
  59. echo test sslv2/sslv3 with client authentication via BIO pair
  60. $ssltest -bio_pair -client_auth $CA $extra || exit 1
  61. echo test sslv2/sslv3 with both client and server authentication via BIO pair
  62. $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
  63. echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
  64. $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
  65. #############################################################################
  66. if ../apps/openssl no-dh; then
  67. echo skipping anonymous DH tests
  68. else
  69. echo test tls1 with 1024bit anonymous DH, multiple handshakes
  70. $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
  71. fi
  72. if ../apps/openssl no-rsa; then
  73. echo skipping RSA tests
  74. else
  75. echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
  76. ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
  77. if ../apps/openssl no-dh; then
  78. echo skipping RSA+DHE tests
  79. else
  80. echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
  81. ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
  82. fi
  83. fi
  84. exit 0