Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 1 | $! TESTSSL.COM |
| 2 | $ |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 3 | $ __arch = "VAX" |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 4 | $ if f$getsyi("cpu") .ge. 128 then - |
Richard Levitte | 407a410 | 2010-01-27 09:18:42 +0000 | [diff] [blame] | 5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 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]" |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 12 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 25 | $ ssltest = "mcr ''texe_dir'ssltest -key ''key'"+ - |
| 26 | " -cert ''cert' -c_key ''key' -c_cert ''cert'" |
| 27 | $! |
Richard Levitte | 908df4d | 2010-11-18 22:44:48 +0000 | [diff] [blame] | 28 | $ set noon |
Richard Levitte | cde245b | 2000-03-18 09:11:00 +0000 | [diff] [blame] | 29 | $ define/user sys$output testssl-x509-output. |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 30 | $ define/user sys$error nla0: |
| 31 | $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 32 | $ define/user sys$error nla0: |
Richard Levitte | cde245b | 2000-03-18 09:11:00 +0000 | [diff] [blame] | 33 | $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 34 | $ if $severity .eq. 1 |
| 35 | $ then |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 36 | $ dsa_cert = "YES" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 37 | $ else |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 38 | $ dsa_cert = "NO" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 39 | $ endif |
Richard Levitte | cde245b | 2000-03-18 09:11:00 +0000 | [diff] [blame] | 40 | $ delete testssl-x509-output.;* |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 | $!########################################################################### |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 51 | $ |
| 52 | $ write sys$output "test sslv2" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 53 | $ 'ssltest' -ssl2 |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 54 | $ if $severity .ne. 1 then goto exit3 |
| 55 | $ |
| 56 | $ write sys$output "test sslv2 with server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 57 | $ 'ssltest' -ssl2 -server_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 58 | $ if $severity .ne. 1 then goto exit3 |
| 59 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 65 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 70 | $ |
| 71 | $ write sys$output "test sslv3" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 72 | $ 'ssltest' -ssl3 |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 73 | $ if $severity .ne. 1 then goto exit3 |
| 74 | $ |
| 75 | $ write sys$output "test sslv3 with server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 76 | $ 'ssltest' -ssl3 -server_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 77 | $ if $severity .ne. 1 then goto exit3 |
| 78 | $ |
| 79 | $ write sys$output "test sslv3 with client authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 80 | $ 'ssltest' -ssl3 -client_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 81 | $ if $severity .ne. 1 then goto exit3 |
| 82 | $ |
| 83 | $ write sys$output "test sslv3 with both client and server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 84 | $ 'ssltest' -ssl3 -server_auth -client_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 85 | $ if $severity .ne. 1 then goto exit3 |
| 86 | $ |
| 87 | $ write sys$output "test sslv2/sslv3" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 88 | $ 'ssltest' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 89 | $ if $severity .ne. 1 then goto exit3 |
| 90 | $ |
| 91 | $ write sys$output "test sslv2/sslv3 with server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 92 | $ 'ssltest' -server_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 93 | $ if $severity .ne. 1 then goto exit3 |
| 94 | $ |
| 95 | $ write sys$output "test sslv2/sslv3 with client authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 96 | $ 'ssltest' -client_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 97 | $ if $severity .ne. 1 then goto exit3 |
| 98 | $ |
| 99 | $ write sys$output "test sslv2/sslv3 with both client and server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 100 | $ 'ssltest' -server_auth -client_auth 'CA' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 101 | $ if $severity .ne. 1 then goto exit3 |
| 102 | $ |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 103 | $ write sys$output "test sslv2 via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 104 | $ 'ssltest' -bio_pair -ssl2 |
Richard Levitte | da0fc5b | 2000-01-30 13:44:08 +0000 | [diff] [blame] | 105 | $ if $severity .ne. 1 then goto exit3 |
| 106 | $ |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 107 | $ write sys$output "test sslv2 with server authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 108 | $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 109 | $ if $severity .ne. 1 then goto exit3 |
| 110 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 116 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 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 |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 121 | $ |
| 122 | $ write sys$output "test sslv3 via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 123 | $ 'ssltest' -bio_pair -ssl3 |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 124 | $ if $severity .ne. 1 then goto exit3 |
| 125 | $ |
| 126 | $ write sys$output "test sslv3 with server authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 127 | $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 128 | $ if $severity .ne. 1 then goto exit3 |
| 129 | $ |
| 130 | $ write sys$output "test sslv3 with client authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 131 | $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 132 | $ if $severity .ne. 1 then goto exit3 |
| 133 | |
| 134 | $ write sys$output "test sslv3 with both client and server authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 135 | $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 136 | $ if $severity .ne. 1 then goto exit3 |
| 137 | $ |
| 138 | $ write sys$output "test sslv2/sslv3 via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 139 | $ 'ssltest' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 140 | $ if $severity .ne. 1 then goto exit3 |
| 141 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 142 | $ if .not. dsa_cert |
| 143 | $ then |
| 144 | $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" |
| 145 | $ 'ssltest' -bio_pair -no_dhe |
| 146 | $ if $severity .ne. 1 then goto exit3 |
| 147 | $ endif |
| 148 | $ |
| 149 | $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" |
| 150 | $ 'ssltest' -bio_pair -dhe1024dsa -v |
Richard Levitte | 82a2d07 | 1999-11-12 01:43:55 +0000 | [diff] [blame] | 151 | $ if $severity .ne. 1 then goto exit3 |
| 152 | $ |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 153 | $ write sys$output "test sslv2/sslv3 with server authentication" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 154 | $ 'ssltest' -bio_pair -server_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 155 | $ if $severity .ne. 1 then goto exit3 |
| 156 | $ |
| 157 | $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 158 | $ 'ssltest' -bio_pair -client_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 159 | $ if $severity .ne. 1 then goto exit3 |
| 160 | $ |
| 161 | $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair" |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 162 | $ 'ssltest' -bio_pair -server_auth -client_auth 'CA' |
Ulf Möller | 8c197cc | 1999-07-28 23:25:59 +0000 | [diff] [blame] | 163 | $ if $severity .ne. 1 then goto exit3 |
| 164 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 165 | $!########################################################################### |
| 166 | $ |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 167 | $ define/user sys$output nla0: |
| 168 | $ mcr 'exe_dir'openssl no-rsa |
Richard Levitte | 0d3f2cc | 2002-12-12 18:43:10 +0000 | [diff] [blame] | 169 | $ no_rsa=$SEVERITY |
| 170 | $ define/user sys$output nla0: |
| 171 | $ mcr 'exe_dir'openssl no-dh |
| 172 | $ no_dh=$SEVERITY |
Richard Levitte | 0d3f2cc | 2002-12-12 18:43:10 +0000 | [diff] [blame] | 173 | $ |
| 174 | $ if no_dh |
| 175 | $ then |
| 176 | $ write sys$output "skipping anonymous DH tests" |
| 177 | $ else |
| 178 | $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes" |
| 179 | $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time |
| 180 | $ if $severity .ne. 1 then goto exit3 |
| 181 | $ endif |
| 182 | $ |
| 183 | $ if no_rsa |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 184 | $ then |
| 185 | $ write sys$output "skipping RSA tests" |
| 186 | $ else |
| 187 | $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes" |
| 188 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time |
| 189 | $ if $severity .ne. 1 then goto exit3 |
| 190 | $ |
Richard Levitte | 0d3f2cc | 2002-12-12 18:43:10 +0000 | [diff] [blame] | 191 | $ if no_dh |
| 192 | $ then |
| 193 | $ write sys$output "skipping RSA+DHE tests" |
| 194 | $ else |
| 195 | $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes" |
| 196 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time |
| 197 | $ if $severity .ne. 1 then goto exit3 |
| 198 | $ endif |
Richard Levitte | c13ee21 | 2000-03-13 22:27:52 +0000 | [diff] [blame] | 199 | $ endif |
| 200 | $ |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 201 | $ RET = 1 |
| 202 | $ goto exit |
| 203 | $ exit3: |
| 204 | $ RET = 3 |
| 205 | $ exit: |
Richard Levitte | cde245b | 2000-03-18 09:11:00 +0000 | [diff] [blame] | 206 | $ if p3 .eqs. "" then delete certs.tmp;* |
Richard Levitte | 908df4d | 2010-11-18 22:44:48 +0000 | [diff] [blame] | 207 | $ set on |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 208 | $ exit 'RET' |