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