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_heartbeat,test_constant_time
61 $ tests = f$edit(tests,"COLLAPSE")
65 $ ECDSATEST := ecdsatest
66 $ ECDHTEST := ecdhtest
68 $ IDEATEST := ideatest
70 $ SHA1TEST := sha1test
71 $ SHA256TEST := sha256t
72 $ SHA512TEST := sha512t
73 $ MDC2TEST := mdc2test
78 $ HMACTEST := hmactest
84 $ CASTTEST := casttest
86 $ RANDTEST := randtest
89 $ METHTEST := methtest
92 $ ENGINETEST := enginetest
95 $ JPAKETEST := jpaketest
97 $ ASN1TEST := asn1test
98 $ HEARTBEATTEST := heartbeat_test
99 $ CONSTTIMETEST := constant_time_test
103 $ tests_e = f$element(tests_i,",",tests)
104 $ tests_i = tests_i + 1
105 $ if tests_e .eqs. "," then goto exit
106 $ write sys$output "---> ''tests_e'"
111 $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
114 $ mcr 'texe_dir''destest'
117 $ mcr 'texe_dir''ideatest'
120 $ mcr 'texe_dir''shatest'
121 $ mcr 'texe_dir''sha1test'
122 $ mcr 'texe_dir''sha256test'
123 $ mcr 'texe_dir''sha512test'
126 $ mcr 'texe_dir''mdc2test'
129 $ mcr 'texe_dir''md5test'
132 $ mcr 'texe_dir''md4test'
135 $ mcr 'texe_dir''hmactest'
138 $ mcr 'texe_dir''wptest'
141 $ mcr 'texe_dir''md2test'
144 $ mcr 'texe_dir''rmdtest'
147 $ mcr 'texe_dir''bftest'
150 $ mcr 'texe_dir''casttest'
153 $ mcr 'texe_dir''rc2test'
156 $ mcr 'texe_dir''rc4test'
159 $ mcr 'texe_dir''rc5test'
162 $ mcr 'texe_dir''randtest'
165 $ @testenc.com 'pointer_size'
169 $ define sys$error test_x509.err
170 $ write sys$output "test normal x509v1 certificate"
171 $ @tx509.com "" 'pointer_size'
172 $ write sys$output "test first x509v3 certificate"
173 $ @tx509.com v3-cert1.pem 'pointer_size'
174 $ write sys$output "test second x509v3 certificate"
175 $ @tx509.com v3-cert2.pem 'pointer_size'
181 $ define sys$error test_rsa.err
182 $ @trsa.com "" 'pointer_size'
184 $ mcr 'texe_dir''rsatest'
189 $ define sys$error test_crl.err
190 $ @tcrl.com "" 'pointer_size'
196 $ define sys$error test_sid.err
197 $ @tsid.com "" 'pointer_size'
203 $ define sys$error test_req.err
204 $ @treq.com "" 'pointer_size'
205 $ @treq.com testreq2.pem 'pointer_size'
211 $ define sys$error test_pkcs7.err
212 $ @tpkcs7.com "" 'pointer_size'
213 $ @tpkcs7d.com "" 'pointer_size'
219 "starting big number library test, could take a while..."
221 $ define sys$error test_bn.err
222 $ define sys$output test_bn.out
226 $ deassign sys$output
230 $ create /fdl = sys$input bntest-vms.tmp
232 ORGANIZATION sequential
235 $ define /user_mode sys$output bntest-vms.tmp
236 $ mcr 'texe_dir''bntest'
237 $ define /user_mode sys$input bntest-vms.tmp
238 $ define /user_mode sys$output bntest-vms.out
240 $ @ bntest.com bntest-vms.out
244 $ delete bntest-vms.out;*
245 $ delete bntest-vms.tmp;*
248 $ create /fdl = sys$input bntest-vms.sh
250 ORGANIZATION sequential
253 $ open /append bntest_file bntest-vms.sh
254 $ type /output = bntest_file sys$input:
255 << __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"'
256 $ define /user_mode sys$output bntest-vms.tmp
257 $ mcr 'texe_dir''bntest'
258 $ copy bntest-vms.tmp bntest_file
259 $ delete bntest-vms.tmp;*
260 $ type /output = bntest_file sys$input:
263 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
264 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
265 $ write sys$output "-- went well."
266 $ write sys$output ""
268 $ write sys$output "test a^b%c implementations"
269 $ mcr 'texe_dir''exptest'
272 $ write sys$output "test elliptic curves"
273 $ mcr 'texe_dir''ectest'
276 $ write sys$output "test ecdsa"
277 $ mcr 'texe_dir''ecdsatest'
280 $ write sys$output "test ecdh"
281 $ mcr 'texe_dir''ecdhtest'
284 $ write sys$output "The following command should have some OK's and some failures"
285 $ write sys$output "There are definitly a few expired certificates"
286 $ @tverify.com 'pointer_size'
289 $ write sys$output "Generate a set of DH parameters"
290 $ mcr 'texe_dir''dhtest'
293 $ write sys$output "Generate a set of DSA parameters"
294 $ mcr 'texe_dir''dsatest'
297 $ write sys$output "Generate and verify a certificate request"
298 $ @testgen.com 'pointer_size'
301 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
302 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
304 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
306 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
310 $ write sys$output "Generate and certify a test certificate"
311 $ @testss.com 'pointer_size'
314 $ write sys$output "Manipulate the ENGINE structures"
315 $ mcr 'texe_dir''enginetest'
318 $ write sys$output "test SSL protocol"
319 $ gosub maybe_test_ss
320 $ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
324 $ define /user_mode sys$output test_ca.out
325 $ mcr 'exe_dir'openssl no-rsa
326 $ save_severity=$SEVERITY
330 $ write sys$output "skipping CA.com test -- requires RSA"
332 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
333 $ @testca.com 'pointer_size'
337 $! write sys$output "test AES"
338 $! !mcr 'texe_dir''aestest'
342 $ define /user_mode sys$output nla0:
343 $ mcr 'exe_dir'openssl no-rsa
344 $ save_severity=$SEVERITY
348 $ write sys$output "skipping testtsa.com test -- requires RSA"
350 $ @testtsa.com "" "" "" 'pointer_size'
354 $ write sys$output "Test IGE mode"
355 $ mcr 'texe_dir''igetest'
358 $ write sys$output "Test JPAKE"
359 $ mcr 'texe_dir''jpaketest'
362 $ write sys$output "CMS consistency test"
363 $ ! Define the logical name used to find openssl.exe in the perl script.
364 $ define /user_mode osslx 'exe_dir'
368 $ write sys$output "Test SRP"
369 $ mcr 'texe_dir''srptest'
372 $ write sys$output "Test HEARTBEAT"
373 $ mcr 'texe_dir''heartbeattest'
375 $ test_constant_time:
376 $ write sys$output "Test constant time utilities"
377 $ mcr 'texe_dir''consttimetest'
382 $ on error then goto exit2 ! In case openssl.exe didn't build.
383 $ mcr 'exe_dir'openssl version -a
385 $ set default '__save_default'