Implement EC_GFp_mont_method.
[openssl.git] / test / tests.com
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 := -
22         test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
23         test_md2,test_mdc2,-
24         test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,-
25         test_rand,test_bn,test_ec,test_enc,test_x509,test_rsa,test_crl,test_sid,-
26         test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
27         test_ss,test_ca,test_engine,test_ssl
28 $       endif
29 $       tests = f$edit(tests,"COLLAPSE")
30 $
31 $       BNTEST :=       bntest
32 $       ECTEST :=       ectest
33 $       EXPTEST :=      exptest
34 $       IDEATEST :=     ideatest
35 $       SHATEST :=      shatest
36 $       SHA1TEST :=     sha1test
37 $       MDC2TEST :=     mdc2test
38 $       RMDTEST :=      rmdtest
39 $       MD2TEST :=      md2test
40 $       MD4TEST :=      md4test
41 $       MD5TEST :=      md5test
42 $       HMACTEST :=     hmactest
43 $       RC2TEST :=      rc2test
44 $       RC4TEST :=      rc4test
45 $       RC5TEST :=      rc5test
46 $       BFTEST :=       bftest
47 $       CASTTEST :=     casttest
48 $       DESTEST :=      destest
49 $       RANDTEST :=     randtest
50 $       DHTEST :=       dhtest
51 $       DSATEST :=      dsatest
52 $       METHTEST :=     methtest
53 $       SSLTEST :=      ssltest
54 $       RSATEST :=      rsa_test
55 $       ENGINETEST :=   enginetest
56 $
57 $       tests_i = 0
58 $ loop_tests:
59 $       tests_e = f$element(tests_i,",",tests)
60 $       tests_i = tests_i + 1
61 $       if tests_e .eqs. "," then goto exit
62 $       gosub 'tests_e'
63 $       goto loop_tests
64 $
65 $ test_des:
66 $       mcr 'texe_dir''destest'
67 $       return
68 $ test_idea:
69 $       mcr 'texe_dir''ideatest'
70 $       return
71 $ test_sha:
72 $       mcr 'texe_dir''shatest'
73 $       mcr 'texe_dir''sha1test'
74 $       return
75 $ test_mdc2:
76 $       mcr 'texe_dir''mdc2test'
77 $       return
78 $ test_md5:
79 $       mcr 'texe_dir''md5test'
80 $       return
81 $ test_md4:
82 $       mcr 'texe_dir''md4test'
83 $       return
84 $ test_hmac:
85 $       mcr 'texe_dir''hmactest'
86 $       return
87 $ test_md2:
88 $       mcr 'texe_dir''md2test'
89 $       return
90 $ test_rmd:
91 $       mcr 'texe_dir''rmdtest'
92 $       return
93 $ test_bf:
94 $       mcr 'texe_dir''bftest'
95 $       return
96 $ test_cast:
97 $       mcr 'texe_dir''casttest'
98 $       return
99 $ test_rc2:
100 $       mcr 'texe_dir''rc2test'
101 $       return
102 $ test_rc4:
103 $       mcr 'texe_dir''rc4test'
104 $       return
105 $ test_rc5:
106 $       mcr 'texe_dir''rc5test'
107 $       return
108 $ test_rand:
109 $       mcr 'texe_dir''randtest'
110 $       return
111 $ test_enc:
112 $       @testenc.com
113 $       return
114 $ test_x509:
115 $       define sys$error nla0:
116 $       write sys$output "test normal x509v1 certificate"
117 $       @tx509.com
118 $       write sys$output "test first x509v3 certificate"
119 $       @tx509.com v3-cert1.pem
120 $       write sys$output "test second x509v3 certificate"
121 $       @tx509.com v3-cert2.pem
122 $       deassign sys$error
123 $       return
124 $ test_rsa:
125 $       define sys$error nla0:
126 $       @trsa.com
127 $       deassign sys$error
128 $       mcr 'texe_dir''rsatest'
129 $       return
130 $ test_crl:
131 $       define sys$error nla0:
132 $       @tcrl.com
133 $       deassign sys$error
134 $       return
135 $ test_sid:
136 $       define sys$error nla0:
137 $       @tsid.com
138 $       deassign sys$error
139 $       return
140 $ test_req:
141 $       define sys$error nla0:
142 $       @treq.com
143 $       @treq.com testreq2.pem
144 $       deassign sys$error
145 $       return
146 $ test_pkcs7:
147 $       define sys$error nla0:
148 $       @tpkcs7.com
149 $       @tpkcs7d.com
150 $       deassign sys$error
151 $       return
152 $ test_bn:
153 $       write sys$output "starting big number library test, could take a while..."
154 $       create bntest-vms.fdl
155 FILE
156         ORGANIZATION    sequential
157 RECORD
158         FORMAT          stream_lf
159 $       create/fdl=bntest-vms.fdl bntest-vms.sh
160 $       open/append foo bntest-vms.sh
161 $       type/output=foo: sys$input:
162 << __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"'
163 $       define/user sys$output bntest-vms.tmp
164 $       mcr 'texe_dir''bntest'
165 $       copy bntest-vms.tmp foo:
166 $       delete bntest-vms.tmp;*
167 $       type/output=foo: sys$input:
168 __FOO__
169 $       close foo
170 $       write sys$output "-- copy the [.test]bntest-vms.sh file to a Unix system and run it"
171 $       write sys$output "-- through sh or bash to verify that the bignum operations went well."
172 $       write sys$output ""
173 $       write sys$output "test a^b%c implementations"
174 $       mcr 'texe_dir''exptest'
175 $       return
176 $ test_ec:
177 $       write sys$output "test elliptic curves"
178 $       mcr 'texe_dir''ectest'
179 $       return
180 $ test_verify:
181 $       write sys$output "The following command should have some OK's and some failures"
182 $       write sys$output "There are definitly a few expired certificates"
183 $       @tverify.com
184 $       return
185 $ test_dh:
186 $       write sys$output "Generate a set of DH parameters"
187 $       mcr 'texe_dir''dhtest'
188 $       return
189 $ test_dsa:
190 $       write sys$output "Generate a set of DSA parameters"
191 $       mcr 'texe_dir''dsatest'
192 $       return
193 $ test_gen:
194 $       write sys$output "Generate and verify a certificate request"
195 $       @testgen.com
196 $       return
197 $ maybe_test_ss:
198 $       testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
199 $       if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
200                 goto test_ss
201 $       if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
202                 goto test_ss
203 $       if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
204                 goto test_ss
205 $       return
206 $ test_ss:
207 $       write sys$output "Generate and certify a test certificate"
208 $       @testss.com
209 $       return
210 $ test_engine: 
211 $       write sys$output "Manipulate the ENGINE structures"
212 $       mcr 'texe_dir''enginetest'
213 $       return
214 $ test_ssl:
215 $       write sys$output "test SSL protocol"
216 $       gosub maybe_test_ss
217 $       @testssl.com keyU.ss certU.ss certCA.ss
218 $       return
219 $ test_ca:
220 $       set noon
221 $       define/user sys$output nla0:
222 $       mcr 'exe_dir'openssl no-rsa
223 $       save_severity=$SEVERITY
224 $       set on
225 $       if save_severity
226 $       then
227 $           write sys$output "skipping CA.com test -- requires RSA"
228 $       else
229 $           write sys$output "Generate and certify a test certificate via the 'ca' program"
230 $           @testca.com
231 $       endif
232 $       return
233 $ test_rd: 
234 $       write sys$output "test Rijndael"
235 $       !mcr 'texe_dir''rdtest'
236 $       return
237 $
238 $
239 $ exit:
240 $       set default '__save_default'
241 $       exit