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