testssl.com 6.1 KB

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