testssl.com 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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 sslv2"
  53. $ 'ssltest' -ssl2
  54. $ if $severity .ne. 1 then goto exit3
  55. $
  56. $ write sys$output "test sslv2 with server authentication"
  57. $ 'ssltest' -ssl2 -server_auth 'CA'
  58. $ if $severity .ne. 1 then goto exit3
  59. $
  60. $ if .not. dsa_cert
  61. $ then
  62. $ write sys$output "test sslv2 with client authentication"
  63. $ 'ssltest' -ssl2 -client_auth 'CA'
  64. $ if $severity .ne. 1 then goto exit3
  65. $
  66. $ write sys$output "test sslv2 with both client and server authentication"
  67. $ 'ssltest' -ssl2 -server_auth -client_auth 'CA'
  68. $ if $severity .ne. 1 then goto exit3
  69. $ endif
  70. $
  71. $ write sys$output "test sslv3"
  72. $ 'ssltest' -ssl3
  73. $ if $severity .ne. 1 then goto exit3
  74. $
  75. $ write sys$output "test sslv3 with server authentication"
  76. $ 'ssltest' -ssl3 -server_auth 'CA'
  77. $ if $severity .ne. 1 then goto exit3
  78. $
  79. $ write sys$output "test sslv3 with client authentication"
  80. $ 'ssltest' -ssl3 -client_auth 'CA'
  81. $ if $severity .ne. 1 then goto exit3
  82. $
  83. $ write sys$output "test sslv3 with both client and server authentication"
  84. $ 'ssltest' -ssl3 -server_auth -client_auth 'CA'
  85. $ if $severity .ne. 1 then goto exit3
  86. $
  87. $ write sys$output "test sslv2/sslv3"
  88. $ 'ssltest'
  89. $ if $severity .ne. 1 then goto exit3
  90. $
  91. $ write sys$output "test sslv2/sslv3 with server authentication"
  92. $ 'ssltest' -server_auth 'CA'
  93. $ if $severity .ne. 1 then goto exit3
  94. $
  95. $ write sys$output "test sslv2/sslv3 with client authentication"
  96. $ 'ssltest' -client_auth 'CA'
  97. $ if $severity .ne. 1 then goto exit3
  98. $
  99. $ write sys$output "test sslv2/sslv3 with both client and server authentication"
  100. $ 'ssltest' -server_auth -client_auth 'CA'
  101. $ if $severity .ne. 1 then goto exit3
  102. $
  103. $ write sys$output "test sslv2 via BIO pair"
  104. $ 'ssltest' -bio_pair -ssl2
  105. $ if $severity .ne. 1 then goto exit3
  106. $
  107. $ write sys$output "test sslv2 with server authentication via BIO pair"
  108. $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA'
  109. $ if $severity .ne. 1 then goto exit3
  110. $
  111. $ if .not. dsa_cert
  112. $ then
  113. $ write sys$output "test sslv2 with client authentication via BIO pair"
  114. $ 'ssltest' -bio_pair -ssl2 -client_auth 'CA'
  115. $ if $severity .ne. 1 then goto exit3
  116. $
  117. $ write sys$output "test sslv2 with both client and server authentication via BIO pair"
  118. $ 'ssltest' -bio_pair -ssl2 -server_auth -client_auth 'CA'
  119. $ if $severity .ne. 1 then goto exit3
  120. $ endif
  121. $
  122. $ write sys$output "test sslv3 via BIO pair"
  123. $ 'ssltest' -bio_pair -ssl3
  124. $ if $severity .ne. 1 then goto exit3
  125. $
  126. $ write sys$output "test sslv3 with server authentication via BIO pair"
  127. $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA'
  128. $ if $severity .ne. 1 then goto exit3
  129. $
  130. $ write sys$output "test sslv3 with client authentication via BIO pair"
  131. $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA'
  132. $ if $severity .ne. 1 then goto exit3
  133. $ write sys$output "test sslv3 with both client and server authentication via BIO pair"
  134. $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA'
  135. $ if $severity .ne. 1 then goto exit3
  136. $
  137. $ write sys$output "test sslv2/sslv3 via BIO pair"
  138. $ 'ssltest'
  139. $ if $severity .ne. 1 then goto exit3
  140. $
  141. $ if .not. dsa_cert
  142. $ then
  143. $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair"
  144. $ 'ssltest' -bio_pair -no_dhe
  145. $ if $severity .ne. 1 then goto exit3
  146. $ endif
  147. $
  148. $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair"
  149. $ 'ssltest' -bio_pair -dhe1024dsa -v
  150. $ if $severity .ne. 1 then goto exit3
  151. $
  152. $ write sys$output "test sslv2/sslv3 with server authentication"
  153. $ 'ssltest' -bio_pair -server_auth 'CA'
  154. $ if $severity .ne. 1 then goto exit3
  155. $
  156. $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair"
  157. $ 'ssltest' -bio_pair -client_auth 'CA'
  158. $ if $severity .ne. 1 then goto exit3
  159. $
  160. $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair"
  161. $ 'ssltest' -bio_pair -server_auth -client_auth 'CA'
  162. $ if $severity .ne. 1 then goto exit3
  163. $
  164. $!###########################################################################
  165. $
  166. $ define/user sys$output nla0:
  167. $ mcr 'exe_dir'openssl no-rsa
  168. $ no_rsa=$SEVERITY
  169. $ define/user sys$output nla0:
  170. $ mcr 'exe_dir'openssl no-dh
  171. $ no_dh=$SEVERITY
  172. $
  173. $ if no_dh
  174. $ then
  175. $ write sys$output "skipping anonymous DH tests"
  176. $ else
  177. $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes"
  178. $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time
  179. $ if $severity .ne. 1 then goto exit3
  180. $ endif
  181. $
  182. $ if no_rsa
  183. $ then
  184. $ write sys$output "skipping RSA tests"
  185. $ else
  186. $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes"
  187. $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time
  188. $ if $severity .ne. 1 then goto exit3
  189. $
  190. $ if no_dh
  191. $ then
  192. $ write sys$output "skipping RSA+DHE tests"
  193. $ else
  194. $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes"
  195. $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time
  196. $ if $severity .ne. 1 then goto exit3
  197. $ endif
  198. $ endif
  199. $
  200. $ RET = 1
  201. $ goto exit
  202. $ exit3:
  203. $ RET = 3
  204. $ exit:
  205. $ if p3 .eqs. "" then delete certs.tmp;*
  206. $ set on
  207. $ exit 'RET'