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
62 $ tests = f$edit(tests,"COLLAPSE")
66 $ ECDSATEST := ecdsatest
67 $ ECDHTEST := ecdhtest
69 $ IDEATEST := ideatest
71 $ SHA1TEST := sha1test
72 $ SHA256TEST := sha256t
73 $ SHA512TEST := sha512t
74 $ MDC2TEST := mdc2test
79 $ HMACTEST := hmactest
85 $ CASTTEST := casttest
87 $ RANDTEST := randtest
90 $ METHTEST := methtest
93 $ ENGINETEST := enginetest
95 $ EVPEXTRATEST := evp_extra_test
97 $ JPAKETEST := jpaketest
99 $ V3NAMETEST := v3nametest
100 $ ASN1TEST := asn1test
101 $ HEARTBEATTEST := heartbeat_test
102 $ CONSTTIMETEST := constant_time_test
103 $ VERIFYEXTRATEST := verify_extra_test
104 $ CLIENTHELLOTEST := clienthellotest
105 $ SSLV2CONFTEST := sslv2conftest
109 $ tests_e = f$element(tests_i,",",tests)
110 $ tests_i = tests_i + 1
111 $ if tests_e .eqs. "," then goto exit
112 $ write sys$output "---> ''tests_e'"
117 $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
120 $ mcr 'texe_dir''evpextratest'
123 $ mcr 'texe_dir''destest'
126 $ mcr 'texe_dir''ideatest'
129 $ mcr 'texe_dir''shatest'
130 $ mcr 'texe_dir''sha1test'
131 $ mcr 'texe_dir''sha256test'
132 $ mcr 'texe_dir''sha512test'
135 $ mcr 'texe_dir''mdc2test'
138 $ mcr 'texe_dir''md5test'
141 $ mcr 'texe_dir''md4test'
144 $ mcr 'texe_dir''hmactest'
147 $ mcr 'texe_dir''wptest'
150 $ mcr 'texe_dir''md2test'
153 $ mcr 'texe_dir''rmdtest'
156 $ mcr 'texe_dir''bftest'
159 $ mcr 'texe_dir''casttest'
162 $ mcr 'texe_dir''rc2test'
165 $ mcr 'texe_dir''rc4test'
168 $ mcr 'texe_dir''rc5test'
171 $ mcr 'texe_dir''randtest'
174 $ @testenc.com 'pointer_size'
178 $ define sys$error test_x509.err
179 $ write sys$output "test normal x509v1 certificate"
180 $ @tx509.com "" 'pointer_size'
181 $ write sys$output "test first x509v3 certificate"
182 $ @tx509.com v3-cert1.pem 'pointer_size'
183 $ write sys$output "test second x509v3 certificate"
184 $ @tx509.com v3-cert2.pem 'pointer_size'
190 $ define sys$error test_rsa.err
191 $ @trsa.com "" 'pointer_size'
193 $ mcr 'texe_dir''rsatest'
198 $ define sys$error test_crl.err
199 $ @tcrl.com "" 'pointer_size'
205 $ define sys$error test_sid.err
206 $ @tsid.com "" 'pointer_size'
212 $ define sys$error test_req.err
213 $ @treq.com "" 'pointer_size'
214 $ @treq.com testreq2.pem 'pointer_size'
220 $ define sys$error test_pkcs7.err
221 $ @tpkcs7.com "" 'pointer_size'
222 $ @tpkcs7d.com "" 'pointer_size'
228 "starting big number library test, could take a while..."
230 $ define sys$error test_bn.err
231 $ define sys$output test_bn.out
235 $ deassign sys$output
239 $ create /fdl = sys$input bntest-vms.tmp
241 ORGANIZATION sequential
244 $ define /user_mode sys$output bntest-vms.tmp
245 $ mcr 'texe_dir''bntest'
246 $ define /user_mode sys$input bntest-vms.tmp
247 $ define /user_mode sys$output bntest-vms.out
249 $ @ bntest.com bntest-vms.out
253 $ delete bntest-vms.out;*
254 $ delete bntest-vms.tmp;*
257 $ create /fdl = sys$input bntest-vms.sh
259 ORGANIZATION sequential
262 $ open /append bntest_file bntest-vms.sh
263 $ type /output = bntest_file sys$input:
264 << __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"'
265 $ define /user_mode sys$output bntest-vms.tmp
266 $ mcr 'texe_dir''bntest'
267 $ copy bntest-vms.tmp bntest_file
268 $ delete bntest-vms.tmp;*
269 $ type /output = bntest_file sys$input:
272 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
273 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
274 $ write sys$output "-- went well."
275 $ write sys$output ""
277 $ write sys$output "test a^b%c implementations"
278 $ mcr 'texe_dir''exptest'
281 $ write sys$output "test elliptic curves"
282 $ mcr 'texe_dir''ectest'
285 $ write sys$output "test ecdsa"
286 $ mcr 'texe_dir''ecdsatest'
289 $ write sys$output "test ecdh"
290 $ mcr 'texe_dir''ecdhtest'
293 $ write sys$output "The following command should have some OK's and some failures"
294 $ write sys$output "There are definitly a few expired certificates"
295 $ @tverify.com 'pointer_size'
298 $ write sys$output "Generate a set of DH parameters"
299 $ mcr 'texe_dir''dhtest'
302 $ write sys$output "Generate a set of DSA parameters"
303 $ mcr 'texe_dir''dsatest'
306 $ write sys$output "Generate and verify a certificate request"
307 $ @testgen.com 'pointer_size'
310 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
311 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
313 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
315 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
319 $ write sys$output "Generate and certify a test certificate"
320 $ @testss.com 'pointer_size'
323 $ write sys$output "Manipulate the ENGINE structures"
324 $ mcr 'texe_dir''enginetest'
327 $ write sys$output "test SSL protocol"
328 $ gosub maybe_test_ss
329 $ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
333 $ define /user_mode sys$output test_ca.out
334 $ mcr 'exe_dir'openssl no-rsa
335 $ save_severity=$SEVERITY
339 $ write sys$output "skipping CA.com test -- requires RSA"
341 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
342 $ @testca.com 'pointer_size'
346 $! write sys$output "test AES"
347 $! !mcr 'texe_dir''aestest'
351 $ define /user_mode sys$output nla0:
352 $ mcr 'exe_dir'openssl no-rsa
353 $ save_severity=$SEVERITY
357 $ write sys$output "skipping testtsa.com test -- requires RSA"
359 $ @testtsa.com "" "" "" 'pointer_size'
363 $ write sys$output "Test IGE mode"
364 $ mcr 'texe_dir''igetest'
367 $ write sys$output "Test JPAKE"
368 $ mcr 'texe_dir''jpaketest'
371 $ write sys$output "CMS consistency test"
372 $ ! Define the logical name used to find openssl.exe in the perl script.
373 $ define /user_mode osslx 'exe_dir'
377 $ write sys$output "Test SRP"
378 $ mcr 'texe_dir''srptest'
381 $ write sys$output "Test OCSP"
385 $ write sys$output "Test V3NAME"
386 $ mcr 'texe_dir''v3nametest'
389 $ write sys$output "Test HEARTBEAT"
390 $ mcr 'texe_dir''heartbeattest'
392 $ test_constant_time:
393 $ write sys$output "Test constant time utilities"
394 $ mcr 'texe_dir''consttimetest'
397 $ write sys$output "''START' test_verify_extra"
398 $ mcr 'texe_dir''verifyextratest'
401 $ write sys$output "''START' test_clienthello"
402 $ mcr 'texe_dir''clienthellotest'
404 $ test_sslv2conftest:
405 $ write sys$output "''START' test_sslv2conftest"
406 $ mcr 'texe_dir''sslv2conftest'
410 $ on error then goto exit2 ! In case openssl.exe didn't build.
411 $ mcr 'exe_dir'openssl version -a
413 $ set default '__save_default'