blob: f19edc4719f85f6735258b9f92180687e5a2e9c1 [file] [log] [blame]
Ulf Möller7d7d2cb1999-05-13 11:37:32 +00001$! TESTSSL.COM
2$
Richard Levitte537c9822011-03-19 10:58:14 +00003$ __arch = "VAX"
Richard Levittecc8cc9a2009-05-15 16:36:56 +00004$ if f$getsyi("cpu") .ge. 128 then -
Richard Levitte407a4102010-01-27 09:18:42 +00005 __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
Richard Levitte537c9822011-03-19 10:58:14 +00006$ 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öller7d7d2cb1999-05-13 11:37:32 +000012$
Richard Levittec13ee212000-03-13 22:27:52 +000013$ 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 Levitte537c9822011-03-19 10:58:14 +000025$ ssltest = "mcr ''texe_dir'ssltest -key ''key'"+ -
26 " -cert ''cert' -c_key ''key' -c_cert ''cert'"
27$!
Richard Levitte908df4d2010-11-18 22:44:48 +000028$ set noon
Richard Levittecde245b2000-03-18 09:11:00 +000029$ define/user sys$output testssl-x509-output.
Richard Levittec13ee212000-03-13 22:27:52 +000030$ define/user sys$error nla0:
31$ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout
Richard Levittec13ee212000-03-13 22:27:52 +000032$ define/user sys$error nla0:
Richard Levittecde245b2000-03-18 09:11:00 +000033$ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact
Richard Levittec13ee212000-03-13 22:27:52 +000034$ if $severity .eq. 1
35$ then
Richard Levitte537c9822011-03-19 10:58:14 +000036$ dsa_cert = "YES"
Richard Levittec13ee212000-03-13 22:27:52 +000037$ else
Richard Levitte537c9822011-03-19 10:58:14 +000038$ dsa_cert = "NO"
Richard Levittec13ee212000-03-13 22:27:52 +000039$ endif
Richard Levittecde245b2000-03-18 09:11:00 +000040$ delete testssl-x509-output.;*
Richard Levittec13ee212000-03-13 22:27:52 +000041$
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öller7d7d2cb1999-05-13 11:37:32 +000051$
52$ write sys$output "test sslv2"
Richard Levittec13ee212000-03-13 22:27:52 +000053$ 'ssltest' -ssl2
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000054$ if $severity .ne. 1 then goto exit3
55$
56$ write sys$output "test sslv2 with server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000057$ 'ssltest' -ssl2 -server_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000058$ if $severity .ne. 1 then goto exit3
59$
Richard Levittec13ee212000-03-13 22:27:52 +000060$ 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öller7d7d2cb1999-05-13 11:37:32 +000065$
Richard Levittec13ee212000-03-13 22:27:52 +000066$ 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öller7d7d2cb1999-05-13 11:37:32 +000070$
71$ write sys$output "test sslv3"
Richard Levittec13ee212000-03-13 22:27:52 +000072$ 'ssltest' -ssl3
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000073$ if $severity .ne. 1 then goto exit3
74$
75$ write sys$output "test sslv3 with server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000076$ 'ssltest' -ssl3 -server_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000077$ if $severity .ne. 1 then goto exit3
78$
79$ write sys$output "test sslv3 with client authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000080$ 'ssltest' -ssl3 -client_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000081$ if $severity .ne. 1 then goto exit3
82$
83$ write sys$output "test sslv3 with both client and server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000084$ 'ssltest' -ssl3 -server_auth -client_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000085$ if $severity .ne. 1 then goto exit3
86$
87$ write sys$output "test sslv2/sslv3"
Richard Levittec13ee212000-03-13 22:27:52 +000088$ 'ssltest'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000089$ if $severity .ne. 1 then goto exit3
90$
91$ write sys$output "test sslv2/sslv3 with server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000092$ 'ssltest' -server_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000093$ if $severity .ne. 1 then goto exit3
94$
95$ write sys$output "test sslv2/sslv3 with client authentication"
Richard Levittec13ee212000-03-13 22:27:52 +000096$ 'ssltest' -client_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +000097$ if $severity .ne. 1 then goto exit3
98$
99$ write sys$output "test sslv2/sslv3 with both client and server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +0000100$ 'ssltest' -server_auth -client_auth 'CA'
Ulf Möller7d7d2cb1999-05-13 11:37:32 +0000101$ if $severity .ne. 1 then goto exit3
102$
Ulf Möller8c197cc1999-07-28 23:25:59 +0000103$ write sys$output "test sslv2 via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000104$ 'ssltest' -bio_pair -ssl2
Richard Levitteda0fc5b2000-01-30 13:44:08 +0000105$ if $severity .ne. 1 then goto exit3
106$
Ulf Möller8c197cc1999-07-28 23:25:59 +0000107$ write sys$output "test sslv2 with server authentication via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000108$ 'ssltest' -bio_pair -ssl2 -server_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000109$ if $severity .ne. 1 then goto exit3
110$
Richard Levittec13ee212000-03-13 22:27:52 +0000111$ 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öller8c197cc1999-07-28 23:25:59 +0000116$
Richard Levittec13ee212000-03-13 22:27:52 +0000117$ 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öller8c197cc1999-07-28 23:25:59 +0000121$
122$ write sys$output "test sslv3 via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000123$ 'ssltest' -bio_pair -ssl3
Ulf Möller8c197cc1999-07-28 23:25:59 +0000124$ if $severity .ne. 1 then goto exit3
125$
126$ write sys$output "test sslv3 with server authentication via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000127$ 'ssltest' -bio_pair -ssl3 -server_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000128$ if $severity .ne. 1 then goto exit3
129$
130$ write sys$output "test sslv3 with client authentication via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000131$ 'ssltest' -bio_pair -ssl3 -client_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000132$ if $severity .ne. 1 then goto exit3
133
134$ write sys$output "test sslv3 with both client and server authentication via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000135$ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000136$ if $severity .ne. 1 then goto exit3
137$
138$ write sys$output "test sslv2/sslv3 via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000139$ 'ssltest'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000140$ if $severity .ne. 1 then goto exit3
141$
Richard Levittec13ee212000-03-13 22:27:52 +0000142$ 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 Levitte82a2d071999-11-12 01:43:55 +0000151$ if $severity .ne. 1 then goto exit3
152$
Ulf Möller8c197cc1999-07-28 23:25:59 +0000153$ write sys$output "test sslv2/sslv3 with server authentication"
Richard Levittec13ee212000-03-13 22:27:52 +0000154$ 'ssltest' -bio_pair -server_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000155$ if $severity .ne. 1 then goto exit3
156$
157$ write sys$output "test sslv2/sslv3 with client authentication via BIO pair"
Richard Levittec13ee212000-03-13 22:27:52 +0000158$ 'ssltest' -bio_pair -client_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000159$ 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 Levittec13ee212000-03-13 22:27:52 +0000162$ 'ssltest' -bio_pair -server_auth -client_auth 'CA'
Ulf Möller8c197cc1999-07-28 23:25:59 +0000163$ if $severity .ne. 1 then goto exit3
164$
Richard Levittec13ee212000-03-13 22:27:52 +0000165$!###########################################################################
166$
Richard Levittec13ee212000-03-13 22:27:52 +0000167$ define/user sys$output nla0:
168$ mcr 'exe_dir'openssl no-rsa
Richard Levitte0d3f2cc2002-12-12 18:43:10 +0000169$ no_rsa=$SEVERITY
170$ define/user sys$output nla0:
171$ mcr 'exe_dir'openssl no-dh
172$ no_dh=$SEVERITY
Richard Levitte0d3f2cc2002-12-12 18:43:10 +0000173$
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 Levittec13ee212000-03-13 22:27:52 +0000184$ 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 Levitte0d3f2cc2002-12-12 18:43:10 +0000191$ 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 Levittec13ee212000-03-13 22:27:52 +0000199$ endif
200$
Ulf Möller7d7d2cb1999-05-13 11:37:32 +0000201$ RET = 1
202$ goto exit
203$ exit3:
204$ RET = 3
205$ exit:
Richard Levittecde245b2000-03-18 09:11:00 +0000206$ if p3 .eqs. "" then delete certs.tmp;*
Richard Levitte908df4d2010-11-18 22:44:48 +0000207$ set on
Ulf Möller7d7d2cb1999-05-13 11:37:32 +0000208$ exit 'RET'