2
0

testssl.com 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. $! TESTSSL.COM
  2. $
  3. $ __arch = "VAX"
  4. $ if f$getsyi("cpu") .ge. 128 then -
  5. __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
  6. $ if __arch .eqs. "" then __arch = "UNK"
  7. $!
  8. $ if (p4 .eqs. "64") then __arch = __arch+ "_64"
  9. $!
  10. $ texe_dir = "sys$disk:[-.''__arch'.exe.test]"
  11. $ exe_dir = "sys$disk:[-.''__arch'.exe.apps]"
  12. $
  13. $ if p1 .eqs. ""
  14. $ then
  15. $ key="[-.apps]server.pem"
  16. $ else
  17. $ key=p1
  18. $ endif
  19. $ if p2 .eqs. ""
  20. $ then
  21. $ cert="[-.apps]server.pem"
  22. $ else
  23. $ cert=p2
  24. $ endif
  25. $ ssltest = "mcr ''texe_dir'ssltest -key ''key'"+ -
  26. " -cert ''cert' -c_key ''key' -c_cert ''cert'"
  27. $!
  28. $ set noon
  29. $ define/user sys$output testssl-x509-output.
  30. $ define/user sys$error nla0:
  31. $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout
  32. $ define/user sys$error nla0:
  33. $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact
  34. $ if $severity .eq. 1
  35. $ then
  36. $ dsa_cert = "YES"
  37. $ else
  38. $ dsa_cert = "NO"
  39. $ endif
  40. $ delete testssl-x509-output.;*
  41. $
  42. $ if p3 .eqs. ""
  43. $ then
  44. $ copy/concatenate [-.certs]*.pem certs.tmp
  45. $ CA = """-CAfile"" certs.tmp"
  46. $ else
  47. $ CA = """-CAfile"" "+p3
  48. $ endif
  49. $
  50. $!###########################################################################
  51. $
  52. $ write sys$output "test sslv3"
  53. $ 'ssltest' -ssl3
  54. $ if $severity .ne. 1 then goto exit3
  55. $
  56. $ write sys$output "test sslv3 with server authentication"
  57. $ 'ssltest' -ssl3 -server_auth 'CA'
  58. $ if $severity .ne. 1 then goto exit3
  59. $
  60. $ write sys$output "test sslv3 with client authentication"
  61. $ 'ssltest' -ssl3 -client_auth 'CA'
  62. $ if $severity .ne. 1 then goto exit3
  63. $
  64. $ write sys$output "test sslv3 with both client and server authentication"
  65. $ 'ssltest' -ssl3 -server_auth -client_auth 'CA'
  66. $ if $severity .ne. 1 then goto exit3
  67. $
  68. $ write sys$output "test sslv2/sslv3"
  69. $ 'ssltest'
  70. $ if $severity .ne. 1 then goto exit3
  71. $
  72. $ write sys$output "test sslv2/sslv3 with server authentication"
  73. $ 'ssltest' -server_auth 'CA'
  74. $ if $severity .ne. 1 then goto exit3
  75. $
  76. $ write sys$output "test sslv2/sslv3 with client authentication"
  77. $ 'ssltest' -client_auth 'CA'
  78. $ if $severity .ne. 1 then goto exit3
  79. $
  80. $ write sys$output "test sslv2/sslv3 with both client and server authentication"
  81. $ 'ssltest' -server_auth -client_auth 'CA'
  82. $ if $severity .ne. 1 then goto exit3
  83. $
  84. $ write sys$output "test sslv3 via BIO pair"
  85. $ 'ssltest' -bio_pair -ssl3
  86. $ if $severity .ne. 1 then goto exit3
  87. $
  88. $ write sys$output "test sslv3 with server authentication via BIO pair"
  89. $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA'
  90. $ if $severity .ne. 1 then goto exit3
  91. $
  92. $ write sys$output "test sslv3 with client authentication via BIO pair"
  93. $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA'
  94. $ if $severity .ne. 1 then goto exit3
  95. $ write sys$output "test sslv3 with both client and server authentication via BIO pair"
  96. $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA'
  97. $ if $severity .ne. 1 then goto exit3
  98. $
  99. $ write sys$output "test sslv2/sslv3 via BIO pair"
  100. $ 'ssltest'
  101. $ if $severity .ne. 1 then goto exit3
  102. $
  103. $ if .not. dsa_cert
  104. $ then
  105. $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair"
  106. $ 'ssltest' -bio_pair -no_dhe
  107. $ if $severity .ne. 1 then goto exit3
  108. $ endif
  109. $
  110. $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair"
  111. $ 'ssltest' -bio_pair -dhe1024dsa -v
  112. $ if $severity .ne. 1 then goto exit3
  113. $
  114. $ write sys$output "test sslv2/sslv3 with server authentication"
  115. $ 'ssltest' -bio_pair -server_auth 'CA'
  116. $ if $severity .ne. 1 then goto exit3
  117. $
  118. $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair"
  119. $ 'ssltest' -bio_pair -client_auth 'CA'
  120. $ if $severity .ne. 1 then goto exit3
  121. $
  122. $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair"
  123. $ 'ssltest' -bio_pair -server_auth -client_auth 'CA'
  124. $ if $severity .ne. 1 then goto exit3
  125. $
  126. $!###########################################################################
  127. $
  128. $ define/user sys$output nla0:
  129. $ mcr 'exe_dir'openssl no-rsa
  130. $ no_rsa=$SEVERITY
  131. $ define/user sys$output nla0:
  132. $ mcr 'exe_dir'openssl no-dhparam
  133. $ no_dh=$SEVERITY
  134. $
  135. $ if no_dh
  136. $ then
  137. $ write sys$output "skipping anonymous DH tests"
  138. $ else
  139. $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes"
  140. $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time
  141. $ if $severity .ne. 1 then goto exit3
  142. $ endif
  143. $
  144. $ if no_rsa
  145. $ then
  146. $ write sys$output "skipping RSA tests"
  147. $ else
  148. $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes"
  149. $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time
  150. $ if $severity .ne. 1 then goto exit3
  151. $
  152. $ if no_dh
  153. $ then
  154. $ write sys$output "skipping RSA+DHE tests"
  155. $ else
  156. $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes"
  157. $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time
  158. $ if $severity .ne. 1 then goto exit3
  159. $ endif
  160. $ endif
  161. $
  162. $ RET = 1
  163. $ goto exit
  164. $ exit3:
  165. $ RET = 3
  166. $ exit:
  167. $ if p3 .eqs. "" then delete certs.tmp;*
  168. $ set on
  169. $ exit 'RET'