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