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,-
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
36 $ IDEATEST := ideatest
38 $ SHA1TEST := sha1test
39 $ MDC2TEST := mdc2test
44 $ HMACTEST := hmactest
49 $ CASTTEST := casttest
51 $ RANDTEST := randtest
54 $ METHTEST := methtest
57 $ ENGINETEST := enginetest
62 $ tests_e = f$element(tests_i,",",tests)
63 $ tests_i = tests_i + 1
64 $ if tests_e .eqs. "," then goto exit
69 $ mcr 'texe_dir''evptest' evptests.txt
72 $ mcr 'texe_dir''destest'
75 $ mcr 'texe_dir''ideatest'
78 $ mcr 'texe_dir''shatest'
79 $ mcr 'texe_dir''sha1test'
82 $ mcr 'texe_dir''mdc2test'
85 $ mcr 'texe_dir''md5test'
88 $ mcr 'texe_dir''md4test'
91 $ mcr 'texe_dir''hmactest'
94 $ mcr 'texe_dir''md2test'
97 $ mcr 'texe_dir''rmdtest'
100 $ mcr 'texe_dir''bftest'
103 $ mcr 'texe_dir''casttest'
106 $ mcr 'texe_dir''rc2test'
109 $ mcr 'texe_dir''rc4test'
112 $ mcr 'texe_dir''rc5test'
115 $ mcr 'texe_dir''randtest'
121 $ define sys$error nla0:
122 $ write sys$output "test normal x509v1 certificate"
124 $ write sys$output "test first x509v3 certificate"
125 $ @tx509.com v3-cert1.pem
126 $ write sys$output "test second x509v3 certificate"
127 $ @tx509.com v3-cert2.pem
131 $ define sys$error nla0:
134 $ mcr 'texe_dir''rsatest'
137 $ define sys$error nla0:
142 $ define sys$error nla0:
147 $ define sys$error nla0:
149 $ @treq.com testreq2.pem
153 $ define sys$error nla0:
159 $ write sys$output "starting big number library test, could take a while..."
160 $ create bntest-vms.fdl
162 ORGANIZATION sequential
165 $ create/fdl=bntest-vms.fdl bntest-vms.sh
166 $ open/append foo bntest-vms.sh
167 $ type/output=foo: sys$input:
168 << __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"'
169 $ define/user sys$output bntest-vms.tmp
170 $ mcr 'texe_dir''bntest'
171 $ copy bntest-vms.tmp foo:
172 $ delete bntest-vms.tmp;*
173 $ type/output=foo: sys$input:
176 $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
177 $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
178 $ write sys$output "-- went well."
179 $ write sys$output ""
180 $ write sys$output "test a^b%c implementations"
181 $ mcr 'texe_dir''exptest'
184 $ write sys$output "test elliptic curves"
185 $ mcr 'texe_dir''ectest'
188 $ write sys$output "test ecdsa"
189 $ mcr 'texe_dir''ecdsatest'
192 $ write sys$output "The following command should have some OK's and some failures"
193 $ write sys$output "There are definitly a few expired certificates"
197 $ write sys$output "Generate a set of DH parameters"
198 $ mcr 'texe_dir''dhtest'
201 $ write sys$output "Generate a set of DSA parameters"
202 $ mcr 'texe_dir''dsatest'
205 $ write sys$output "Generate and verify a certificate request"
209 $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
210 $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
212 $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
214 $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
218 $ write sys$output "Generate and certify a test certificate"
222 $ write sys$output "Manipulate the ENGINE structures"
223 $ mcr 'texe_dir''enginetest'
226 $ write sys$output "test SSL protocol"
227 $ gosub maybe_test_ss
228 $ @testssl.com keyU.ss certU.ss certCA.ss
232 $ define/user sys$output nla0:
233 $ mcr 'exe_dir'openssl no-rsa
234 $ save_severity=$SEVERITY
238 $ write sys$output "skipping CA.com test -- requires RSA"
240 $ write sys$output "Generate and certify a test certificate via the 'ca' program"
245 $ write sys$output "test Rijndael"
246 $ !mcr 'texe_dir''rdtest'
251 $ set default '__save_default'