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_ssl,test_tsa,test_ige,-
59 test_jpake,test_srp,test_cms,test_ocsp,test_v3name,test_heartbeat,-
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
96 $ JPAKETEST := jpaketest
98 $ V3NAMETEST := v3nametest
99 $ ASN1TEST := asn1test
100 $ HEARTBEATTEST := heartbeat_test
101 $ CONSTTIMETEST := constant_time_test
105 $ tests_e = f$element(tests_i,",",tests)
106 $ tests_i = tests_i + 1
107 $ if tests_e .eqs. "," then goto exit
108 $ write sys$output "---> ''tests_e'"
113 $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
116 $ mcr 'texe_dir''destest'
119 $ mcr 'texe_dir''ideatest'
122 $ mcr 'texe_dir''shatest'
123 $ mcr 'texe_dir''sha1test'
124 $ mcr 'texe_dir''sha256test'
125 $ mcr 'texe_dir''sha512test'
128 $ mcr 'texe_dir''mdc2test'
131 $ mcr 'texe_dir''md5test'
134 $ mcr 'texe_dir''md4test'
137 $ mcr 'texe_dir''hmactest'
140 $ mcr 'texe_dir''wptest'
143 $ mcr 'texe_dir''md2test'
146 $ mcr 'texe_dir''rmdtest'
149 $ mcr 'texe_dir''bftest'
152 $ mcr 'texe_dir''casttest'
155 $ mcr 'texe_dir''rc2test'
158 $ mcr 'texe_dir''rc4test'
161 $ mcr 'texe_dir''rc5test'
164 $ mcr 'texe_dir''randtest'
167 $ @testenc.com 'pointer_size'
171 $ define sys$error test_x509.err
172 $ write sys$output "test normal x509v1 certificate"
173 $ @tx509.com "" 'pointer_size'
174 $ write sys$output "test first x509v3 certificate"
175 $ @tx509.com v3-cert1.pem 'pointer_size'
176 $ write sys$output "test second x509v3 certificate"
177 $ @tx509.com v3-cert2.pem 'pointer_size'
183 $ define sys$error test_rsa.err
184 $ @trsa.com "" 'pointer_size'
186 $ mcr 'texe_dir''rsatest'
191 $ define sys$error test_crl.err
192 $ @tcrl.com "" 'pointer_size'
198 $ define sys$error test_sid.err
199 $ @tsid.com "" 'pointer_size'
205 $ define sys$error test_req.err
206 $ @treq.com "" 'pointer_size'
207 $ @treq.com testreq2.pem 'pointer_size'
213 $ define sys$error test_pkcs7.err
214 $ @tpkcs7.com "" 'pointer_size'
215 $ @tpkcs7d.com "" 'pointer_size'
221 "starting big number library test, could take a while..."
223 $ define sys$error test_bn.err
224 $ define sys$output test_bn.out
228 $ deassign sys$output
232 $ create /fdl = sys$input bntest-vms.tmp
234 ORGANIZATION sequential
237 $ define /user_mode sys$output bntest-vms.tmp
238 $ mcr 'texe_dir''bntest'
239 $ define /user_mode sys$input bntest-vms.tmp
240 $ define /user_mode sys$output bntest-vms.out
242 $ @ bntest.com bntest-vms.out
246 $ delete bntest-vms.out;*
247 $ delete bntest-vms.tmp;*
250 $ create /fdl = sys$input bntest-vms.sh
252 ORGANIZATION sequential
255 $ open /append bntest_file bntest-vms.sh
256 $ type /output = bntest_file sys$input:
257 << __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"'
258 $ define /user_mode sys$output bntest-vms.tmp
259 $ mcr 'texe_dir''bntest'
260 $ copy bntest-vms.tmp bntest_file
261 $ delete bntest-vms.tmp;*
262 $ type /output = bntest_file sys$input:
265 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
266 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
267 $ write sys$output "-- went well."
268 $ write sys$output ""
270 $ write sys$output "test a^b%c implementations"
271 $ mcr 'texe_dir''exptest'
274 $ write sys$output "test elliptic curves"
275 $ mcr 'texe_dir''ectest'
278 $ write sys$output "test ecdsa"
279 $ mcr 'texe_dir''ecdsatest'
282 $ write sys$output "test ecdh"
283 $ mcr 'texe_dir''ecdhtest'
286 $ write sys$output "The following command should have some OK's and some failures"
287 $ write sys$output "There are definitly a few expired certificates"
288 $ @tverify.com 'pointer_size'
291 $ write sys$output "Generate a set of DH parameters"
292 $ mcr 'texe_dir''dhtest'
295 $ write sys$output "Generate a set of DSA parameters"
296 $ mcr 'texe_dir''dsatest'
299 $ write sys$output "Generate and verify a certificate request"
300 $ @testgen.com 'pointer_size'
303 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
304 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
306 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
308 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
312 $ write sys$output "Generate and certify a test certificate"
313 $ @testss.com 'pointer_size'
316 $ write sys$output "Manipulate the ENGINE structures"
317 $ mcr 'texe_dir''enginetest'
320 $ write sys$output "test SSL protocol"
321 $ gosub maybe_test_ss
322 $ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
326 $ define /user_mode sys$output test_ca.out
327 $ mcr 'exe_dir'openssl no-rsa
328 $ save_severity=$SEVERITY
332 $ write sys$output "skipping CA.com test -- requires RSA"
334 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
335 $ @testca.com 'pointer_size'
339 $! write sys$output "test AES"
340 $! !mcr 'texe_dir''aestest'
344 $ define /user_mode sys$output nla0:
345 $ mcr 'exe_dir'openssl no-rsa
346 $ save_severity=$SEVERITY
350 $ write sys$output "skipping testtsa.com test -- requires RSA"
352 $ @testtsa.com "" "" "" 'pointer_size'
356 $ write sys$output "Test IGE mode"
357 $ mcr 'texe_dir''igetest'
360 $ write sys$output "Test JPAKE"
361 $ mcr 'texe_dir''jpaketest'
364 $ write sys$output "CMS consistency test"
365 $ ! Define the logical name used to find openssl.exe in the perl script.
366 $ define /user_mode osslx 'exe_dir'
370 $ write sys$output "Test SRP"
371 $ mcr 'texe_dir''srptest'
374 $ write sys$output "Test OCSP"
378 $ write sys$output "Test V3NAME"
379 $ mcr 'texe_dir''v3nametest'
382 $ write sys$output "Test HEARTBEAT"
383 $ mcr 'texe_dir''heartbeattest'
385 $ test_constant_time:
386 $ write sys$output "Test constant time utilities"
387 $ mcr 'texe_dir''consttimetest'
392 $ on error then goto exit2 ! In case openssl.exe didn't build.
393 $ mcr 'exe_dir'openssl version -a
395 $ set default '__save_default'