summaryrefslogtreecommitdiff
path: root/lib/libssl/test/tests.com
blob: a840d5078f0e034f5f89bf56f0e727e4950130aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
$! TESTS.COM  --  Performs the necessary tests
$!
$! P1	tests to be performed.  Empty means all.
$! P2	Pointer size: "", "32", or "64".
$!
$! Announce/identify.
$!
$	proc = f$environment( "procedure")
$	write sys$output "@@@ "+ -
	 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
$!
$	__proc = f$element(0,";",f$environment("procedure"))
$	__here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
$	__save_default = f$environment("default")
$	__arch = "VAX"
$	if f$getsyi("cpu") .ge. 128 then -
	   __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$	if __arch .eqs. "" then __arch = "UNK"
$!
$	__archd = __arch
$       pointer_size = ""
$	if (p2 .eq. "64")
$	then
$	  pointer_size = "64"
$	  __archd = __arch+ "_64"
$	endif
$!
$	texe_dir := sys$disk:[-.'__archd'.exe.test]
$	exe_dir := sys$disk:[-.'__archd'.exe.apps]
$
$	set default '__here'
$
$       ROOT = F$PARSE("sys$disk:[-]A.;0",,,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
$       ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
$       ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
                   - ".][000000" - "[000000." - "][" - "[" - "]"
$       ROOT = ROOT_DEV + "[" + ROOT_DIR
$       DEFINE/NOLOG SSLROOT 'ROOT'.APPS.] /TRANS=CONC
$	openssl_conf := sslroot:[000000]openssl-vms.cnf
$
$	on control_y then goto exit
$	on error then goto exit
$
$	if p1 .nes. ""
$	then
$	    tests = p1
$	else
$! NOTE: This list reflects the list of dependencies following the
$! "alltests" target in Makefile.  This should make it easy to see
$! if there's a difference that needs to be taken care of.
$	    tests := -
	test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
	test_md2,test_mdc2,test_wp,-
	test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_aes,-
	test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,-
	test_enc,test_x509,test_rsa,test_crl,test_sid,-
	test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
	test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,-
	test_jpake,test_srp,test_cms
$	endif
$	tests = f$edit(tests,"COLLAPSE")
$
$	BNTEST :=	bntest
$	ECTEST :=	ectest
$	ECDSATEST :=	ecdsatest
$	ECDHTEST :=	ecdhtest
$	EXPTEST :=	exptest
$	IDEATEST :=	ideatest
$	SHATEST :=	shatest
$	SHA1TEST :=	sha1test
$	SHA256TEST :=	sha256t
$	SHA512TEST :=	sha512t
$	MDC2TEST :=	mdc2test
$	RMDTEST :=	rmdtest
$	MD2TEST :=	md2test
$	MD4TEST :=	md4test
$	MD5TEST :=	md5test
$	HMACTEST :=	hmactest
$	WPTEST :=	wp_test
$	RC2TEST :=	rc2test
$	RC4TEST :=	rc4test
$	RC5TEST :=	rc5test
$	BFTEST :=	bftest
$	CASTTEST :=	casttest
$	DESTEST :=	destest
$	RANDTEST :=	randtest
$	DHTEST :=	dhtest
$	DSATEST :=	dsatest
$	METHTEST :=	methtest
$	SSLTEST :=	ssltest
$	RSATEST :=	rsa_test
$	ENGINETEST :=	enginetest
$	EVPTEST :=	evp_test
$	IGETEST :=	igetest
$	JPAKETEST :=	jpaketest
$	SRPTEST :=	srptest
$	ASN1TEST :=	asn1test
$!
$	tests_i = 0
$ loop_tests:
$	tests_e = f$element(tests_i,",",tests)
$	tests_i = tests_i + 1
$	if tests_e .eqs. "," then goto exit
$	write sys$output "---> ''tests_e'"
$	gosub 'tests_e'
$	goto loop_tests
$
$ test_evp:
$	mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
$	return
$ test_des:
$	mcr 'texe_dir''destest'
$	return
$ test_idea:
$	mcr 'texe_dir''ideatest'
$	return
$ test_sha:
$	mcr 'texe_dir''shatest'
$	mcr 'texe_dir''sha1test'
$	mcr 'texe_dir''sha256test'
$	mcr 'texe_dir''sha512test'
$	return
$ test_mdc2:
$	mcr 'texe_dir''mdc2test'
$	return
$ test_md5:
$	mcr 'texe_dir''md5test'
$	return
$ test_md4:
$	mcr 'texe_dir''md4test'
$	return
$ test_hmac:
$	mcr 'texe_dir''hmactest'
$	return
$ test_wp:
$	mcr 'texe_dir''wptest'
$	return
$ test_md2:
$	mcr 'texe_dir''md2test'
$	return
$ test_rmd:
$	mcr 'texe_dir''rmdtest'
$	return
$ test_bf:
$	mcr 'texe_dir''bftest'
$	return
$ test_cast:
$	mcr 'texe_dir''casttest'
$	return
$ test_rc2:
$	mcr 'texe_dir''rc2test'
$	return
$ test_rc4:
$	mcr 'texe_dir''rc4test'
$	return
$ test_rc5:
$	mcr 'texe_dir''rc5test'
$	return
$ test_rand:
$	mcr 'texe_dir''randtest'
$	return
$ test_enc:
$	@testenc.com 'pointer_size'
$	return
$ test_x509:
$	set noon
$	define sys$error test_x509.err
$	write sys$output "test normal x509v1 certificate"
$	@tx509.com "" 'pointer_size'
$	write sys$output "test first x509v3 certificate"
$	@tx509.com v3-cert1.pem 'pointer_size'
$	write sys$output "test second x509v3 certificate"
$	@tx509.com v3-cert2.pem 'pointer_size'
$	deassign sys$error
$	set on
$	return
$ test_rsa:
$	set noon
$	define sys$error test_rsa.err
$	@trsa.com "" 'pointer_size'
$	deassign sys$error
$	mcr 'texe_dir''rsatest'
$	set on
$	return
$ test_crl:
$	set noon
$	define sys$error test_crl.err
$	@tcrl.com "" 'pointer_size'
$	deassign sys$error
$	set on
$	return
$ test_sid:
$	set noon
$	define sys$error test_sid.err
$	@tsid.com "" 'pointer_size'
$	deassign sys$error
$	set on
$	return
$ test_req:
$	set noon
$	define sys$error test_req.err
$	@treq.com "" 'pointer_size'
$	@treq.com testreq2.pem 'pointer_size'
$	deassign sys$error
$	set on
$	return
$ test_pkcs7:
$	set noon
$	define sys$error test_pkcs7.err
$	@tpkcs7.com "" 'pointer_size'
$	@tpkcs7d.com "" 'pointer_size'
$	deassign sys$error
$	set on
$	return
$ test_bn:
$	write sys$output -
	      "starting big number library test, could take a while..."
$	set noon
$	define sys$error test_bn.err
$	define sys$output test_bn.out
$	@ bctest.com
$	status = $status
$	deassign sys$error
$	deassign sys$output
$	set on
$	if (status)
$	then
$	    create /fdl = sys$input bntest-vms.tmp
FILE
	ORGANIZATION	sequential
RECORD
	FORMAT		stream_lf
$	    define /user_mode sys$output bntest-vms.tmp
$	    mcr 'texe_dir''bntest'
$	    define /user_mode sys$input bntest-vms.tmp
$	    define /user_mode sys$output bntest-vms.out
$	    bc
$	    @ bntest.com bntest-vms.out
$	    status = $status
$	    if (status)
$	    then
$		delete bntest-vms.out;*
$		delete bntest-vms.tmp;*
$	    endif
$	else
$	    create /fdl = sys$input bntest-vms.sh
FILE
	ORGANIZATION	sequential
RECORD
	FORMAT		stream_lf
$	    open /append bntest_file bntest-vms.sh
$	    type /output = bntest_file sys$input:
<< __FOO__ sh -c "`sh ./bctest`" | perl -e '$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} else {print STDERR "."; $i++;}} print STDERR "\n$i tests passed\n"'
$	    define /user_mode sys$output bntest-vms.tmp
$	    mcr 'texe_dir''bntest'
$	    copy bntest-vms.tmp bntest_file
$	    delete bntest-vms.tmp;*
$	    type /output = bntest_file sys$input:
__FOO__
$	    close bntest_file
$	    write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
$	    write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
$	    write sys$output "-- went well."
$	    write sys$output ""
$	endif
$	write sys$output "test a^b%c implementations"
$	mcr 'texe_dir''exptest'
$	return
$ test_ec:
$	write sys$output "test elliptic curves"
$	mcr 'texe_dir''ectest'
$	return
$ test_ecdsa:
$	write sys$output "test ecdsa"
$	mcr 'texe_dir''ecdsatest'
$	return
$ test_ecdh:
$	write sys$output "test ecdh"
$	mcr 'texe_dir''ecdhtest'
$	return
$ test_verify:
$	write sys$output "The following command should have some OK's and some failures"
$	write sys$output "There are definitly a few expired certificates"
$	@tverify.com 'pointer_size'
$	return
$ test_dh:
$	write sys$output "Generate a set of DH parameters"
$	mcr 'texe_dir''dhtest'
$	return
$ test_dsa:
$	write sys$output "Generate a set of DSA parameters"
$	mcr 'texe_dir''dsatest'
$	return
$ test_gen:
$	write sys$output "Generate and verify a certificate request"
$	@testgen.com 'pointer_size'
$	return
$ maybe_test_ss:
$	testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
$	if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
		goto test_ss
$	if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
		goto test_ss
$	if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
		goto test_ss
$	return
$ test_ss:
$	write sys$output "Generate and certify a test certificate"
$	@testss.com 'pointer_size'
$	return
$ test_engine: 
$	write sys$output "Manipulate the ENGINE structures"
$	mcr 'texe_dir''enginetest'
$	return
$ test_ssl:
$	write sys$output "test SSL protocol"
$	gosub maybe_test_ss
$	@testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
$	return
$ test_ca:
$	set noon
$	define /user_mode sys$output test_ca.out
$	mcr 'exe_dir'openssl no-rsa
$	save_severity=$SEVERITY
$	set on
$	if save_severity
$	then
$	    write sys$output "skipping CA.com test -- requires RSA"
$	else
$	    write sys$output "Generate and certify a test certificate via the 'ca' program"
$	    @testca.com 'pointer_size'
$	endif
$	return
$ test_aes: 
$!	write sys$output "test AES"
$!	!mcr 'texe_dir''aestest'
$	return
$ test_tsa:
$	set noon
$	define /user_mode sys$output nla0:
$	mcr 'exe_dir'openssl no-rsa
$	save_severity=$SEVERITY
$	set on
$	if save_severity
$	then
$	    write sys$output "skipping testtsa.com test -- requires RSA"
$	else
$	    @testtsa.com "" "" "" 'pointer_size'
$	endif
$	return
$ test_ige: 
$	write sys$output "Test IGE mode"
$	mcr 'texe_dir''igetest'
$	return
$ test_jpake: 
$	write sys$output "Test JPAKE"
$	mcr 'texe_dir''jpaketest'
$	return
$ test_cms:
$	write sys$output "CMS consistency test"
$	! Define the logical name used to find openssl.exe in the perl script.
$	define /user_mode osslx 'exe_dir'
$	perl CMS-TEST.PL
$	return
$ test_srp: 
$	write sys$output "Test SRP"
$	mcr 'texe_dir''srptest'
$	return
$
$
$ exit:
$	mcr 'exe_dir'openssl version -a
$	set default '__save_default'
$	deassign sslroot
$	exit