]>
Commit | Line | Data |
---|---|---|
7d7d2cbc UM |
1 | $! TESTS.COM -- Performs the necessary tests |
2 | $! | |
3 | $! P1 tests to be performed. Empty means all. | |
4 | $ | |
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") | |
8 | $ __arch := VAX | |
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] | |
12 | $ | |
13 | $ set default '__here' | |
14 | $ on control_y then goto exit | |
15 | $ on error then goto exit | |
16 | $ | |
17 | $ if p1 .nes. "" | |
18 | $ then | |
19 | $ tests = p1 | |
20 | $ else | |
21 | $ tests := - | |
eec79f9b RL |
22 | test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,- |
23 | test_md2,test_mdc2,- | |
66a0def8 | 24 | test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,- |
da0bca64 | 25 | test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,- |
1f4eada3 | 26 | test_enc,test_x509,test_rsa,test_crl,test_sid,- |
d593983d | 27 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- |
1f4eada3 | 28 | test_ss,test_ca,test_engine,test_evp,test_ssl |
7d7d2cbc UM |
29 | $ endif |
30 | $ tests = f$edit(tests,"COLLAPSE") | |
31 | $ | |
32 | $ BNTEST := bntest | |
e0a9ba9c | 33 | $ ECTEST := ectest |
1f4eada3 | 34 | $ ECDSATEST := ecdsatest |
da0bca64 | 35 | $ ECDHTEST := ecdhtest |
7d7d2cbc UM |
36 | $ EXPTEST := exptest |
37 | $ IDEATEST := ideatest | |
38 | $ SHATEST := shatest | |
39 | $ SHA1TEST := sha1test | |
40 | $ MDC2TEST := mdc2test | |
41 | $ RMDTEST := rmdtest | |
42 | $ MD2TEST := md2test | |
eec79f9b | 43 | $ MD4TEST := md4test |
7d7d2cbc UM |
44 | $ MD5TEST := md5test |
45 | $ HMACTEST := hmactest | |
46 | $ RC2TEST := rc2test | |
47 | $ RC4TEST := rc4test | |
48 | $ RC5TEST := rc5test | |
49 | $ BFTEST := bftest | |
50 | $ CASTTEST := casttest | |
51 | $ DESTEST := destest | |
52 | $ RANDTEST := randtest | |
53 | $ DHTEST := dhtest | |
54 | $ DSATEST := dsatest | |
55 | $ METHTEST := methtest | |
56 | $ SSLTEST := ssltest | |
721b5b2a | 57 | $ RSATEST := rsa_test |
5270e702 | 58 | $ ENGINETEST := enginetest |
e32587d5 | 59 | $ EVPTEST := evp_test |
7d7d2cbc UM |
60 | $ |
61 | $ tests_i = 0 | |
62 | $ loop_tests: | |
63 | $ tests_e = f$element(tests_i,",",tests) | |
64 | $ tests_i = tests_i + 1 | |
65 | $ if tests_e .eqs. "," then goto exit | |
c13ee214 RL |
66 | $ gosub 'tests_e' |
67 | $ goto loop_tests | |
7d7d2cbc | 68 | $ |
e32587d5 RL |
69 | $ test_evp: |
70 | $ mcr 'texe_dir''evptest' evptests.txt | |
71 | $ return | |
7d7d2cbc UM |
72 | $ test_des: |
73 | $ mcr 'texe_dir''destest' | |
c13ee214 | 74 | $ return |
7d7d2cbc UM |
75 | $ test_idea: |
76 | $ mcr 'texe_dir''ideatest' | |
c13ee214 | 77 | $ return |
7d7d2cbc UM |
78 | $ test_sha: |
79 | $ mcr 'texe_dir''shatest' | |
80 | $ mcr 'texe_dir''sha1test' | |
c13ee214 | 81 | $ return |
7d7d2cbc UM |
82 | $ test_mdc2: |
83 | $ mcr 'texe_dir''mdc2test' | |
c13ee214 | 84 | $ return |
7d7d2cbc UM |
85 | $ test_md5: |
86 | $ mcr 'texe_dir''md5test' | |
c13ee214 | 87 | $ return |
eec79f9b RL |
88 | $ test_md4: |
89 | $ mcr 'texe_dir''md4test' | |
90 | $ return | |
7d7d2cbc UM |
91 | $ test_hmac: |
92 | $ mcr 'texe_dir''hmactest' | |
c13ee214 | 93 | $ return |
7d7d2cbc UM |
94 | $ test_md2: |
95 | $ mcr 'texe_dir''md2test' | |
c13ee214 | 96 | $ return |
7d7d2cbc UM |
97 | $ test_rmd: |
98 | $ mcr 'texe_dir''rmdtest' | |
c13ee214 | 99 | $ return |
7d7d2cbc UM |
100 | $ test_bf: |
101 | $ mcr 'texe_dir''bftest' | |
c13ee214 | 102 | $ return |
7d7d2cbc UM |
103 | $ test_cast: |
104 | $ mcr 'texe_dir''casttest' | |
c13ee214 | 105 | $ return |
7d7d2cbc UM |
106 | $ test_rc2: |
107 | $ mcr 'texe_dir''rc2test' | |
c13ee214 | 108 | $ return |
7d7d2cbc UM |
109 | $ test_rc4: |
110 | $ mcr 'texe_dir''rc4test' | |
c13ee214 | 111 | $ return |
7d7d2cbc UM |
112 | $ test_rc5: |
113 | $ mcr 'texe_dir''rc5test' | |
c13ee214 | 114 | $ return |
7d7d2cbc UM |
115 | $ test_rand: |
116 | $ mcr 'texe_dir''randtest' | |
c13ee214 | 117 | $ return |
7d7d2cbc UM |
118 | $ test_enc: |
119 | $ @testenc.com | |
c13ee214 | 120 | $ return |
7d7d2cbc UM |
121 | $ test_x509: |
122 | $ define sys$error nla0: | |
123 | $ write sys$output "test normal x509v1 certificate" | |
124 | $ @tx509.com | |
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 | |
129 | $ deassign sys$error | |
c13ee214 | 130 | $ return |
7d7d2cbc UM |
131 | $ test_rsa: |
132 | $ define sys$error nla0: | |
133 | $ @trsa.com | |
134 | $ deassign sys$error | |
135 | $ mcr 'texe_dir''rsatest' | |
c13ee214 | 136 | $ return |
7d7d2cbc UM |
137 | $ test_crl: |
138 | $ define sys$error nla0: | |
139 | $ @tcrl.com | |
140 | $ deassign sys$error | |
c13ee214 | 141 | $ return |
7d7d2cbc UM |
142 | $ test_sid: |
143 | $ define sys$error nla0: | |
144 | $ @tsid.com | |
145 | $ deassign sys$error | |
c13ee214 | 146 | $ return |
7d7d2cbc UM |
147 | $ test_req: |
148 | $ define sys$error nla0: | |
149 | $ @treq.com | |
150 | $ @treq.com testreq2.pem | |
151 | $ deassign sys$error | |
c13ee214 | 152 | $ return |
7d7d2cbc UM |
153 | $ test_pkcs7: |
154 | $ define sys$error nla0: | |
155 | $ @tpkcs7.com | |
156 | $ @tpkcs7d.com | |
157 | $ deassign sys$error | |
c13ee214 | 158 | $ return |
7d7d2cbc UM |
159 | $ test_bn: |
160 | $ write sys$output "starting big number library test, could take a while..." | |
161 | $ create bntest-vms.fdl | |
162 | FILE | |
163 | ORGANIZATION sequential | |
164 | RECORD | |
165 | FORMAT stream_lf | |
166 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | |
167 | $ open/append foo bntest-vms.sh | |
168 | $ type/output=foo: sys$input: | |
20a9b1a7 | 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"' |
7d7d2cbc UM |
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: | |
175 | __FOO__ | |
176 | $ close foo | |
20a9b1a7 RL |
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." | |
7d7d2cbc UM |
180 | $ write sys$output "" |
181 | $ write sys$output "test a^b%c implementations" | |
182 | $ mcr 'texe_dir''exptest' | |
c13ee214 | 183 | $ return |
e0a9ba9c | 184 | $ test_ec: |
a2b03690 | 185 | $ write sys$output "test elliptic curves" |
e0a9ba9c RL |
186 | $ mcr 'texe_dir''ectest' |
187 | $ return | |
da0bca64 | 188 | $ test_ecdsa: |
1f4eada3 RL |
189 | $ write sys$output "test ecdsa" |
190 | $ mcr 'texe_dir''ecdsatest' | |
191 | $ return | |
da0bca64 RL |
192 | $ test_ecdh: |
193 | $ write sys$output "test ecdh" | |
194 | $ mcr 'texe_dir''ecdhtest' | |
195 | $ return | |
7d7d2cbc UM |
196 | $ test_verify: |
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" | |
199 | $ @tverify.com | |
c13ee214 | 200 | $ return |
7d7d2cbc | 201 | $ test_dh: |
da0fc5bf | 202 | $ write sys$output "Generate a set of DH parameters" |
7d7d2cbc | 203 | $ mcr 'texe_dir''dhtest' |
c13ee214 | 204 | $ return |
7d7d2cbc | 205 | $ test_dsa: |
da0fc5bf | 206 | $ write sys$output "Generate a set of DSA parameters" |
7d7d2cbc | 207 | $ mcr 'texe_dir''dsatest' |
c13ee214 | 208 | $ return |
d593983d | 209 | $ test_gen: |
7d7d2cbc UM |
210 | $ write sys$output "Generate and verify a certificate request" |
211 | $ @testgen.com | |
c13ee214 RL |
212 | $ return |
213 | $ maybe_test_ss: | |
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 - | |
216 | goto test_ss | |
217 | $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then - | |
218 | goto test_ss | |
219 | $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | |
220 | goto test_ss | |
221 | $ return | |
7d7d2cbc UM |
222 | $ test_ss: |
223 | $ write sys$output "Generate and certify a test certificate" | |
224 | $ @testss.com | |
c13ee214 | 225 | $ return |
5270e702 RL |
226 | $ test_engine: |
227 | $ write sys$output "Manipulate the ENGINE structures" | |
228 | $ mcr 'texe_dir''enginetest' | |
229 | $ return | |
7d7d2cbc UM |
230 | $ test_ssl: |
231 | $ write sys$output "test SSL protocol" | |
c13ee214 RL |
232 | $ gosub maybe_test_ss |
233 | $ @testssl.com keyU.ss certU.ss certCA.ss | |
234 | $ return | |
7d7d2cbc | 235 | $ test_ca: |
c13ee214 RL |
236 | $ set noon |
237 | $ define/user sys$output nla0: | |
238 | $ mcr 'exe_dir'openssl no-rsa | |
239 | $ save_severity=$SEVERITY | |
240 | $ set on | |
241 | $ if save_severity | |
242 | $ then | |
243 | $ write sys$output "skipping CA.com test -- requires RSA" | |
244 | $ else | |
245 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | |
246 | $ @testca.com | |
247 | $ endif | |
248 | $ return | |
66a0def8 | 249 | $ test_rd: |
d53d2717 RL |
250 | $ write sys$output "test Rijndael" |
251 | $ !mcr 'texe_dir''rdtest' | |
252 | $ return | |
7d7d2cbc UM |
253 | $ |
254 | $ | |
255 | $ exit: | |
256 | $ set default '__save_default' | |
257 | $ exit |