1 $! TESTS.COM -- Performs the necessary tests
3 $! P1 tests to be performed. Empty means all.
5 $ __proc = f$element(0,";",f$environment("procedure"))
6 $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
7 $ __save_default = f$environment("default")
9 $ if f$getsyi("cpu") .ge. 128 then __arch := AXP
10 $ texe_dir := sys$disk:[-.'__arch'.exe.test]
11 $ exe_dir := sys$disk:[-.'__arch'.exe.apps]
13 $ set default '__here'
14 $ on control_y then goto exit
15 $ on error then goto exit
22 test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
24 test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,-
25 test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,-
26 test_enc,test_x509,test_rsa,test_crl,test_sid,-
27 test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
28 test_ss,test_ca,test_engine,test_evp,test_ssl
30 $ tests = f$edit(tests,"COLLAPSE")
34 $ ECDSATEST := ecdsatest
35 $ ECDHTEST := ecdhtest
37 $ IDEATEST := ideatest
39 $ SHA1TEST := sha1test
40 $ MDC2TEST := mdc2test
45 $ HMACTEST := hmactest
50 $ CASTTEST := casttest
52 $ RANDTEST := randtest
55 $ METHTEST := methtest
58 $ ENGINETEST := enginetest
63 $ tests_e = f$element(tests_i,",",tests)
64 $ tests_i = tests_i + 1
65 $ if tests_e .eqs. "," then goto exit
70 $ mcr 'texe_dir''evptest' evptests.txt
73 $ mcr 'texe_dir''destest'
76 $ mcr 'texe_dir''ideatest'
79 $ mcr 'texe_dir''shatest'
80 $ mcr 'texe_dir''sha1test'
83 $ mcr 'texe_dir''mdc2test'
86 $ mcr 'texe_dir''md5test'
89 $ mcr 'texe_dir''md4test'
92 $ mcr 'texe_dir''hmactest'
95 $ mcr 'texe_dir''md2test'
98 $ mcr 'texe_dir''rmdtest'
101 $ mcr 'texe_dir''bftest'
104 $ mcr 'texe_dir''casttest'
107 $ mcr 'texe_dir''rc2test'
110 $ mcr 'texe_dir''rc4test'
113 $ mcr 'texe_dir''rc5test'
116 $ mcr 'texe_dir''randtest'
122 $ define sys$error nla0:
123 $ write sys$output "test normal x509v1 certificate"
125 $ write sys$output "test first x509v3 certificate"
126 $ @tx509.com v3-cert1.pem
127 $ write sys$output "test second x509v3 certificate"
128 $ @tx509.com v3-cert2.pem
132 $ define sys$error nla0:
135 $ mcr 'texe_dir''rsatest'
138 $ define sys$error nla0:
143 $ define sys$error nla0:
148 $ define sys$error nla0:
150 $ @treq.com testreq2.pem
154 $ define sys$error nla0:
160 $ write sys$output "starting big number library test, could take a while..."
161 $ create bntest-vms.fdl
163 ORGANIZATION sequential
166 $ create/fdl=bntest-vms.fdl bntest-vms.sh
167 $ open/append foo bntest-vms.sh
168 $ type/output=foo: sys$input:
169 << __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"'
170 $ define/user sys$output bntest-vms.tmp
171 $ mcr 'texe_dir''bntest'
172 $ copy bntest-vms.tmp foo:
173 $ delete bntest-vms.tmp;*
174 $ type/output=foo: sys$input:
177 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
178 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
179 $ write sys$output "-- went well."
180 $ write sys$output ""
181 $ write sys$output "test a^b%c implementations"
182 $ mcr 'texe_dir''exptest'
185 $ write sys$output "test elliptic curves"
186 $ mcr 'texe_dir''ectest'
189 $ write sys$output "test ecdsa"
190 $ mcr 'texe_dir''ecdsatest'
193 $ write sys$output "test ecdh"
194 $ mcr 'texe_dir''ecdhtest'
197 $ write sys$output "The following command should have some OK's and some failures"
198 $ write sys$output "There are definitly a few expired certificates"
202 $ write sys$output "Generate a set of DH parameters"
203 $ mcr 'texe_dir''dhtest'
206 $ write sys$output "Generate a set of DSA parameters"
207 $ mcr 'texe_dir''dsatest'
210 $ write sys$output "Generate and verify a certificate request"
214 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
215 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
217 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
219 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
223 $ write sys$output "Generate and certify a test certificate"
227 $ write sys$output "Manipulate the ENGINE structures"
228 $ mcr 'texe_dir''enginetest'
231 $ write sys$output "test SSL protocol"
232 $ gosub maybe_test_ss
233 $ @testssl.com keyU.ss certU.ss certCA.ss
237 $ define/user sys$output nla0:
238 $ mcr 'exe_dir'openssl no-rsa
239 $ save_severity=$SEVERITY
243 $ write sys$output "skipping CA.com test -- requires RSA"
245 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
250 $ write sys$output "test Rijndael"
251 $ !mcr 'texe_dir''rdtest'
256 $ set default '__save_default'