1 $! TESTS.COM -- Performs the necessary tests
3 $! P1 tests to be performed. Empty means all.
4 $! P2 Pointer size: "", "32", or "64".
8 $ proc = f$environment( "procedure")
9 $ write sys$output "@@@ "+ -
10 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
12 $ __proc = f$element(0,";",f$environment("procedure"))
13 $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
14 $ __save_default = f$environment("default")
16 $ if f$getsyi("cpu") .ge. 128 then -
17 __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
18 $ if __arch .eqs. "" then __arch = "UNK"
25 $ __archd = __arch+ "_64"
28 $ texe_dir := sys$disk:[-.'__archd'.exe.test]
29 $ exe_dir := sys$disk:[-.'__archd'.exe.apps]
31 $ set default '__here'
33 $ ROOT = F$PARSE("sys$disk:[-]A.;0",,,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
34 $ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
35 $ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
36 - ".][000000" - "[000000." - "][" - "[" - "]"
37 $ ROOT = ROOT_DEV + "[" + ROOT_DIR
38 $ DEFINE/NOLOG SSLROOT 'ROOT'.APPS.] /TRANS=CONC
39 $ openssl_conf := sslroot:[000000]openssl-vms.cnf
41 $ on control_y then goto exit
42 $ on error then goto exit
48 $! NOTE: This list reflects the list of dependencies following the
49 $! "alltests" target in Makefile. This should make it easy to see
50 $! if there's a difference that needs to be taken care of.
52 test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
53 test_md2,test_mdc2,test_wp,-
54 test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_aes,-
55 test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,-
56 test_enc,test_x509,test_rsa,test_crl,test_sid,-
57 test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
58 test_ss,test_ca,test_engine,test_evp,test_evp_extra,test_ssl,test_tsa,test_ige,-
59 test_jpake,test_srp,test_cms,test_ocsp,test_v3name,test_heartbeat,-
60 test_constant_time,test_verify_extra,test_clienthello,test_sslv2conftest,-
61 test_dtls,test_bad_dtls,test_fatalerr,test_x509_time
63 $ tests = f$edit(tests,"COLLAPSE")
67 $ ECDSATEST := ecdsatest
68 $ ECDHTEST := ecdhtest
70 $ IDEATEST := ideatest
72 $ SHA1TEST := sha1test
73 $ SHA256TEST := sha256t
74 $ SHA512TEST := sha512t
75 $ MDC2TEST := mdc2test
80 $ HMACTEST := hmactest
86 $ CASTTEST := casttest
88 $ RANDTEST := randtest
91 $ METHTEST := methtest
94 $ ENGINETEST := enginetest
96 $ EVPEXTRATEST := evp_extra_test
98 $ JPAKETEST := jpaketest
100 $ V3NAMETEST := v3nametest
101 $ ASN1TEST := asn1test
102 $ HEARTBEATTEST := heartbeat_test
103 $ CONSTTIMETEST := constant_time_test
104 $ VERIFYEXTRATEST := verify_extra_test
105 $ CLIENTHELLOTEST := clienthellotest
106 $ BADDTLSTEST := bad_dtls_test
107 $ SSLV2CONFTEST := sslv2conftest
108 $ DTLSTEST := dtlstest
109 $ FATALERRTEST := fatalerrtest
110 $ X509TIMETEST := x509_time_test
114 $ tests_e = f$element(tests_i,",",tests)
115 $ tests_i = tests_i + 1
116 $ if tests_e .eqs. "," then goto exit
117 $ write sys$output "---> ''tests_e'"
122 $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
125 $ mcr 'texe_dir''evpextratest'
128 $ mcr 'texe_dir''destest'
131 $ mcr 'texe_dir''ideatest'
134 $ mcr 'texe_dir''shatest'
135 $ mcr 'texe_dir''sha1test'
136 $ mcr 'texe_dir''sha256test'
137 $ mcr 'texe_dir''sha512test'
140 $ mcr 'texe_dir''mdc2test'
143 $ mcr 'texe_dir''md5test'
146 $ mcr 'texe_dir''md4test'
149 $ mcr 'texe_dir''hmactest'
152 $ mcr 'texe_dir''wptest'
155 $ mcr 'texe_dir''md2test'
158 $ mcr 'texe_dir''rmdtest'
161 $ mcr 'texe_dir''bftest'
164 $ mcr 'texe_dir''casttest'
167 $ mcr 'texe_dir''rc2test'
170 $ mcr 'texe_dir''rc4test'
173 $ mcr 'texe_dir''rc5test'
176 $ mcr 'texe_dir''randtest'
179 $ @testenc.com 'pointer_size'
183 $ define sys$error test_x509.err
184 $ write sys$output "test normal x509v1 certificate"
185 $ @tx509.com "" 'pointer_size'
186 $ write sys$output "test first x509v3 certificate"
187 $ @tx509.com v3-cert1.pem 'pointer_size'
188 $ write sys$output "test second x509v3 certificate"
189 $ @tx509.com v3-cert2.pem 'pointer_size'
195 $ define sys$error test_rsa.err
196 $ @trsa.com "" 'pointer_size'
198 $ mcr 'texe_dir''rsatest'
203 $ define sys$error test_crl.err
204 $ @tcrl.com "" 'pointer_size'
210 $ define sys$error test_sid.err
211 $ @tsid.com "" 'pointer_size'
217 $ define sys$error test_req.err
218 $ @treq.com "" 'pointer_size'
219 $ @treq.com testreq2.pem 'pointer_size'
225 $ define sys$error test_pkcs7.err
226 $ @tpkcs7.com "" 'pointer_size'
227 $ @tpkcs7d.com "" 'pointer_size'
233 "starting big number library test, could take a while..."
235 $ define sys$error test_bn.err
236 $ define sys$output test_bn.out
240 $ deassign sys$output
244 $ create /fdl = sys$input bntest-vms.tmp
246 ORGANIZATION sequential
249 $ define /user_mode sys$output bntest-vms.tmp
250 $ mcr 'texe_dir''bntest'
251 $ define /user_mode sys$input bntest-vms.tmp
252 $ define /user_mode sys$output bntest-vms.out
254 $ @ bntest.com bntest-vms.out
258 $ delete bntest-vms.out;*
259 $ delete bntest-vms.tmp;*
262 $ create /fdl = sys$input bntest-vms.sh
264 ORGANIZATION sequential
267 $ open /append bntest_file bntest-vms.sh
268 $ type /output = bntest_file sys$input:
269 << __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"'
270 $ define /user_mode sys$output bntest-vms.tmp
271 $ mcr 'texe_dir''bntest'
272 $ copy bntest-vms.tmp bntest_file
273 $ delete bntest-vms.tmp;*
274 $ type /output = bntest_file sys$input:
277 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
278 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
279 $ write sys$output "-- went well."
280 $ write sys$output ""
282 $ write sys$output "test a^b%c implementations"
283 $ mcr 'texe_dir''exptest'
286 $ write sys$output "test elliptic curves"
287 $ mcr 'texe_dir''ectest'
290 $ write sys$output "test ecdsa"
291 $ mcr 'texe_dir''ecdsatest'
294 $ write sys$output "test ecdh"
295 $ mcr 'texe_dir''ecdhtest'
298 $ write sys$output "The following command should have some OK's and some failures"
299 $ write sys$output "There are definitly a few expired certificates"
300 $ @tverify.com 'pointer_size'
303 $ write sys$output "Generate a set of DH parameters"
304 $ mcr 'texe_dir''dhtest'
307 $ write sys$output "Generate a set of DSA parameters"
308 $ mcr 'texe_dir''dsatest'
311 $ write sys$output "Generate and verify a certificate request"
312 $ @testgen.com 'pointer_size'
315 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
316 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
318 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
320 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
324 $ write sys$output "Generate and certify a test certificate"
325 $ @testss.com 'pointer_size'
328 $ write sys$output "Manipulate the ENGINE structures"
329 $ mcr 'texe_dir''enginetest'
332 $ write sys$output "test SSL protocol"
333 $ gosub maybe_test_ss
334 $ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
338 $ define /user_mode sys$output test_ca.out
339 $ mcr 'exe_dir'openssl no-rsa
340 $ save_severity=$SEVERITY
344 $ write sys$output "skipping CA.com test -- requires RSA"
346 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
347 $ @testca.com 'pointer_size'
351 $! write sys$output "test AES"
352 $! !mcr 'texe_dir''aestest'
356 $ define /user_mode sys$output nla0:
357 $ mcr 'exe_dir'openssl no-rsa
358 $ save_severity=$SEVERITY
362 $ write sys$output "skipping testtsa.com test -- requires RSA"
364 $ @testtsa.com "" "" "" 'pointer_size'
368 $ write sys$output "Test IGE mode"
369 $ mcr 'texe_dir''igetest'
372 $ write sys$output "Test JPAKE"
373 $ mcr 'texe_dir''jpaketest'
376 $ write sys$output "CMS consistency test"
377 $ ! Define the logical name used to find openssl.exe in the perl script.
378 $ define /user_mode osslx 'exe_dir'
382 $ write sys$output "Test SRP"
383 $ mcr 'texe_dir''srptest'
386 $ write sys$output "Test OCSP"
390 $ write sys$output "Test V3NAME"
391 $ mcr 'texe_dir''v3nametest'
394 $ write sys$output "Test HEARTBEAT"
395 $ mcr 'texe_dir''heartbeattest'
397 $ test_constant_time:
398 $ write sys$output "Test constant time utilities"
399 $ mcr 'texe_dir''consttimetest'
402 $ write sys$output "''START' test_verify_extra"
403 $ mcr 'texe_dir''verifyextratest'
406 $ write sys$output "''START' test_clienthello"
407 $ mcr 'texe_dir''clienthellotest'
410 $ write sys$output "''START' test_bad_dtls"
411 $ mcr 'texe_dir''baddtlstest'
415 $ write sys$output "''START' test_fatalerrtest"
416 $ mcr 'texe_dir''fatalerrtest' 'ROOT'.APPS]server.pem 'ROOT'.APPS]server.pem
420 $ write sys$output "''START' test_x509_time"
421 $ mcr 'texe_dir''x509timetest'
424 $ test_sslv2conftest:
425 $ write sys$output "''START' test_sslv2conftest"
426 $ mcr 'texe_dir''sslv2conftest'
429 $ write sys$output "''START' test_dtls"
430 $ mcr 'texe_dir''dtlstest' 'ROOT'.APPS]server.pem 'ROOT'.APPS]server.pem
434 $ on error then goto exit2 ! In case openssl.exe didn't build.
435 $ mcr 'exe_dir'openssl version -a
437 $ set default '__save_default'