diff options
Diffstat (limited to 'src/lib/libssl/test')
-rw-r--r-- | src/lib/libssl/test/Makefile.ssl | 796 | ||||
-rw-r--r-- | src/lib/libssl/test/dummytest.c | 48 | ||||
-rw-r--r-- | src/lib/libssl/test/enginetest.c | 274 | ||||
-rw-r--r-- | src/lib/libssl/test/evptests.txt | 183 | ||||
-rw-r--r-- | src/lib/libssl/test/maketests.com | 913 | ||||
-rw-r--r-- | src/lib/libssl/test/md4test.c | 134 | ||||
-rw-r--r-- | src/lib/libssl/test/rsa_test.c | 318 | ||||
-rw-r--r-- | src/lib/libssl/test/tcrl.com | 83 | ||||
-rw-r--r-- | src/lib/libssl/test/testca.com | 78 | ||||
-rw-r--r-- | src/lib/libssl/test/testenc.com | 62 | ||||
-rw-r--r-- | src/lib/libssl/test/testgen.com | 52 | ||||
-rw-r--r-- | src/lib/libssl/test/tests.com | 246 | ||||
-rw-r--r-- | src/lib/libssl/test/testss.com | 118 | ||||
-rw-r--r-- | src/lib/libssl/test/testssl.com | 204 | ||||
-rw-r--r-- | src/lib/libssl/test/tpkcs7.com | 54 | ||||
-rw-r--r-- | src/lib/libssl/test/tpkcs7d.com | 47 | ||||
-rw-r--r-- | src/lib/libssl/test/treq.com | 83 | ||||
-rw-r--r-- | src/lib/libssl/test/trsa.com | 94 | ||||
-rw-r--r-- | src/lib/libssl/test/tsid.com | 83 | ||||
-rw-r--r-- | src/lib/libssl/test/tverify.com | 26 | ||||
-rw-r--r-- | src/lib/libssl/test/tx509.com | 83 |
21 files changed, 3979 insertions, 0 deletions
diff --git a/src/lib/libssl/test/Makefile.ssl b/src/lib/libssl/test/Makefile.ssl new file mode 100644 index 0000000000..373f17a929 --- /dev/null +++ b/src/lib/libssl/test/Makefile.ssl | |||
@@ -0,0 +1,796 @@ | |||
1 | # | ||
2 | # test/Makefile.ssl | ||
3 | # | ||
4 | |||
5 | DIR= test | ||
6 | TOP= .. | ||
7 | CC= cc | ||
8 | INCLUDES= -I$(TOP) -I../include $(KRB5_INCLUDES) | ||
9 | CFLAG= -g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP= /usr/local/ssl | ||
13 | MAKEFILE= Makefile.ssl | ||
14 | MAKE= make -f $(MAKEFILE) | ||
15 | MAKEDEPPROG= makedepend | ||
16 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
17 | PERL= perl | ||
18 | # KRB5 stuff | ||
19 | KRB5_INCLUDES= | ||
20 | LIBKRB5= | ||
21 | |||
22 | PEX_LIBS= | ||
23 | EX_LIBS= #-lnsl -lsocket | ||
24 | |||
25 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
26 | |||
27 | GENERAL=Makefile.ssl maketests.com \ | ||
28 | tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \ | ||
29 | tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \ | ||
30 | testca.com VMSca-response.1 VMSca-response.2 | ||
31 | |||
32 | DLIBCRYPTO= ../libcrypto.a | ||
33 | DLIBSSL= ../libssl.a | ||
34 | LIBCRYPTO= -L.. -lcrypto | ||
35 | LIBSSL= -L.. -lssl | ||
36 | |||
37 | BNTEST= bntest | ||
38 | ECTEST= ectest | ||
39 | EXPTEST= exptest | ||
40 | IDEATEST= ideatest | ||
41 | SHATEST= shatest | ||
42 | SHA1TEST= sha1test | ||
43 | MDC2TEST= mdc2test | ||
44 | RMDTEST= rmdtest | ||
45 | MD2TEST= md2test | ||
46 | MD4TEST= md4test | ||
47 | MD5TEST= md5test | ||
48 | HMACTEST= hmactest | ||
49 | RC2TEST= rc2test | ||
50 | RC4TEST= rc4test | ||
51 | RC5TEST= rc5test | ||
52 | BFTEST= bftest | ||
53 | CASTTEST= casttest | ||
54 | DESTEST= destest | ||
55 | RANDTEST= randtest | ||
56 | DHTEST= dhtest | ||
57 | DSATEST= dsatest | ||
58 | METHTEST= methtest | ||
59 | SSLTEST= ssltest | ||
60 | RSATEST= rsa_test | ||
61 | ENGINETEST= enginetest | ||
62 | EVPTEST= evp_test | ||
63 | |||
64 | TESTS= alltests | ||
65 | |||
66 | EXE= $(BNTEST) $(ECTEST) $(IDEATEST) $(MD2TEST) $(MD4TEST) $(MD5TEST) $(HMACTEST) \ | ||
67 | $(RC2TEST) $(RC4TEST) $(RC5TEST) \ | ||
68 | $(DESTEST) $(SHATEST) $(SHA1TEST) $(MDC2TEST) $(RMDTEST) \ | ||
69 | $(RANDTEST) $(DHTEST) $(ENGINETEST) \ | ||
70 | $(BFTEST) $(CASTTEST) $(SSLTEST) $(EXPTEST) $(DSATEST) $(RSATEST) \ | ||
71 | $(EVPTEST) | ||
72 | |||
73 | # $(METHTEST) | ||
74 | |||
75 | OBJ= $(BNTEST).o $(ECTEST).o $(IDEATEST).o $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \ | ||
76 | $(HMACTEST).o \ | ||
77 | $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \ | ||
78 | $(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(MDC2TEST).o $(RMDTEST).o \ | ||
79 | $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \ | ||
80 | $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ | ||
81 | $(EVPTEST).o | ||
82 | SRC= $(BNTEST).c $(ECTEST).c $(IDEATEST).c $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ | ||
83 | $(HMACTEST).c \ | ||
84 | $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \ | ||
85 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ | ||
86 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ | ||
87 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ | ||
88 | $(EVPTEST).c | ||
89 | |||
90 | EXHEADER= | ||
91 | HEADER= $(EXHEADER) | ||
92 | |||
93 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
94 | |||
95 | top: | ||
96 | (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all) | ||
97 | |||
98 | all: exe | ||
99 | |||
100 | exe: $(EXE) dummytest | ||
101 | |||
102 | files: | ||
103 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
104 | |||
105 | links: | ||
106 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
107 | |||
108 | generate: $(SRC) | ||
109 | $(SRC): | ||
110 | @sh $(TOP)/util/point.sh dummytest.c $@ | ||
111 | |||
112 | errors: | ||
113 | |||
114 | install: | ||
115 | |||
116 | tags: | ||
117 | ctags $(SRC) | ||
118 | |||
119 | tests: exe apps $(TESTS) | ||
120 | |||
121 | apps: | ||
122 | @(cd ..; $(MAKE) DIRS=apps all) | ||
123 | |||
124 | SET_SO_PATHS=OSSL_LIBPATH="`cd ..; pwd`"; \ | ||
125 | LD_LIBRARY_PATH="$$OSSL_LIBPATH:$$LD_LIBRARY_PATH"; \ | ||
126 | DYLD_LIBRARY_PATH="$$OSSL_LIBPATH:$$DYLD_LIBRARY_PATH"; \ | ||
127 | SHLIB_PATH="$$OSSL_LIBPATH:$$SHLIB_PATH"; \ | ||
128 | LIBPATH="$$OSSL_LIBPATH:$$LIBPATH"; \ | ||
129 | if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="$${LIBPATH}:$$PATH"; fi; \ | ||
130 | export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH | ||
131 | |||
132 | alltests: \ | ||
133 | test_des test_idea test_sha test_md4 test_md5 test_hmac \ | ||
134 | test_md2 test_mdc2 \ | ||
135 | test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \ | ||
136 | test_rand test_bn test_ec test_enc test_x509 test_rsa test_crl test_sid \ | ||
137 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ | ||
138 | test_ss test_ca test_engine test_evp test_ssl | ||
139 | |||
140 | test_evp: | ||
141 | $(SET_SO_PATHS); ./$(EVPTEST) evptests.txt | ||
142 | |||
143 | test_des: | ||
144 | $(SET_SO_PATHS); ./$(DESTEST) | ||
145 | |||
146 | test_idea: | ||
147 | $(SET_SO_PATHS); ./$(IDEATEST) | ||
148 | |||
149 | test_sha: | ||
150 | $(SET_SO_PATHS); ./$(SHATEST) | ||
151 | $(SET_SO_PATHS); ./$(SHA1TEST) | ||
152 | |||
153 | test_mdc2: | ||
154 | $(SET_SO_PATHS); ./$(MDC2TEST) | ||
155 | |||
156 | test_md5: | ||
157 | $(SET_SO_PATHS); ./$(MD5TEST) | ||
158 | |||
159 | test_md4: | ||
160 | $(SET_SO_PATHS); ./$(MD4TEST) | ||
161 | |||
162 | test_hmac: | ||
163 | $(SET_SO_PATHS); ./$(HMACTEST) | ||
164 | |||
165 | test_md2: | ||
166 | $(SET_SO_PATHS); ./$(MD2TEST) | ||
167 | |||
168 | test_rmd: | ||
169 | $(SET_SO_PATHS); ./$(RMDTEST) | ||
170 | |||
171 | test_bf: | ||
172 | $(SET_SO_PATHS); ./$(BFTEST) | ||
173 | |||
174 | test_cast: | ||
175 | $(SET_SO_PATHS); ./$(CASTTEST) | ||
176 | |||
177 | test_rc2: | ||
178 | $(SET_SO_PATHS); ./$(RC2TEST) | ||
179 | |||
180 | test_rc4: | ||
181 | $(SET_SO_PATHS); ./$(RC4TEST) | ||
182 | |||
183 | test_rc5: | ||
184 | $(SET_SO_PATHS); ./$(RC5TEST) | ||
185 | |||
186 | test_rand: | ||
187 | $(SET_SO_PATHS); ./$(RANDTEST) | ||
188 | |||
189 | test_enc: | ||
190 | @$(SET_SO_PATHS); sh ./testenc | ||
191 | |||
192 | test_x509: | ||
193 | echo test normal x509v1 certificate | ||
194 | $(SET_SO_PATHS); sh ./tx509 2>/dev/null | ||
195 | echo test first x509v3 certificate | ||
196 | $(SET_SO_PATHS); sh ./tx509 v3-cert1.pem 2>/dev/null | ||
197 | echo test second x509v3 certificate | ||
198 | $(SET_SO_PATHS); sh ./tx509 v3-cert2.pem 2>/dev/null | ||
199 | |||
200 | test_rsa: | ||
201 | @$(SET_SO_PATHS); sh ./trsa 2>/dev/null | ||
202 | $(SET_SO_PATHS); ./$(RSATEST) | ||
203 | |||
204 | test_crl: | ||
205 | @$(SET_SO_PATHS); sh ./tcrl 2>/dev/null | ||
206 | |||
207 | test_sid: | ||
208 | @$(SET_SO_PATHS); sh ./tsid 2>/dev/null | ||
209 | |||
210 | test_req: | ||
211 | @$(SET_SO_PATHS); sh ./treq 2>/dev/null | ||
212 | @$(SET_SO_PATHS); sh ./treq testreq2.pem 2>/dev/null | ||
213 | |||
214 | test_pkcs7: | ||
215 | @$(SET_SO_PATHS); sh ./tpkcs7 2>/dev/null | ||
216 | @$(SET_SO_PATHS); sh ./tpkcs7d 2>/dev/null | ||
217 | |||
218 | test_bn: | ||
219 | @echo starting big number library test, could take a while... | ||
220 | @$(SET_SO_PATHS); ./$(BNTEST) >tmp.bntest | ||
221 | @echo quit >>tmp.bntest | ||
222 | @echo "running bc" | ||
223 | @<tmp.bntest sh -c "`sh ./bctest ignore`" | $(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"' | ||
224 | @echo 'test a^b%c implementations' | ||
225 | $(SET_SO_PATHS); ./$(EXPTEST) | ||
226 | |||
227 | test_ec: | ||
228 | @echo 'test elliptic curves' | ||
229 | $(SET_SO_PATHS); ./$(ECTEST) | ||
230 | |||
231 | test_verify: | ||
232 | @echo "The following command should have some OK's and some failures" | ||
233 | @echo "There are definitly a few expired certificates" | ||
234 | -$(SET_SO_PATHS); ../apps/openssl verify -CApath ../certs ../certs/*.pem | ||
235 | |||
236 | test_dh: | ||
237 | @echo "Generate a set of DH parameters" | ||
238 | $(SET_SO_PATHS); ./$(DHTEST) | ||
239 | |||
240 | test_dsa: | ||
241 | @echo "Generate a set of DSA parameters" | ||
242 | $(SET_SO_PATHS); ./$(DSATEST) | ||
243 | $(SET_SO_PATHS); ./$(DSATEST) -app2_1 | ||
244 | |||
245 | test_gen: | ||
246 | @echo "Generate and verify a certificate request" | ||
247 | @$(SET_SO_PATHS); sh ./testgen | ||
248 | |||
249 | test_ss keyU.ss certU.ss certCA.ss: testss | ||
250 | @echo "Generate and certify a test certificate" | ||
251 | @$(SET_SO_PATHS); sh ./testss | ||
252 | |||
253 | test_engine: | ||
254 | @echo "Manipulate the ENGINE structures" | ||
255 | $(SET_SO_PATHS); ./$(ENGINETEST) | ||
256 | |||
257 | test_ssl: keyU.ss certU.ss certCA.ss | ||
258 | @echo "test SSL protocol" | ||
259 | @$(SET_SO_PATHS); sh ./testssl keyU.ss certU.ss certCA.ss | ||
260 | |||
261 | test_ca: | ||
262 | @$(SET_SO_PATHS); if ../apps/openssl no-rsa; then \ | ||
263 | echo "skipping CA.sh test -- requires RSA"; \ | ||
264 | else \ | ||
265 | echo "Generate and certify a test certificate via the 'ca' program"; \ | ||
266 | sh ./testca; \ | ||
267 | fi | ||
268 | |||
269 | test_aes: #$(AESTEST) | ||
270 | # @echo "test Rijndael" | ||
271 | # $(SET_SO_PATHS); ./$(AESTEST) | ||
272 | |||
273 | lint: | ||
274 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
275 | |||
276 | depend: | ||
277 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC) | ||
278 | |||
279 | dclean: | ||
280 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
281 | mv -f Makefile.new $(MAKEFILE) | ||
282 | |||
283 | clean: | ||
284 | rm -f .rnd tmp.bntest tmp.bctest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log | ||
285 | |||
286 | $(DLIBSSL): | ||
287 | (cd ..; $(MAKE) DIRS=ssl all) | ||
288 | |||
289 | $(DLIBCRYPTO): | ||
290 | (cd ..; $(MAKE) DIRS=crypto all) | ||
291 | |||
292 | $(RSATEST): $(RSATEST).o $(DLIBCRYPTO) | ||
293 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
294 | $(CC) -o $(RSATEST) $(CFLAGS) $(RSATEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
295 | else \ | ||
296 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
297 | $(CC) -o $(RSATEST) $(CFLAGS) $(RSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
298 | fi | ||
299 | |||
300 | $(BNTEST): $(BNTEST).o $(DLIBCRYPTO) | ||
301 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
302 | $(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
303 | else \ | ||
304 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
305 | $(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
306 | fi | ||
307 | |||
308 | $(ECTEST): $(ECTEST).o $(DLIBCRYPTO) | ||
309 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
310 | $(CC) -o $(ECTEST) $(CFLAGS) $(ECTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
311 | else \ | ||
312 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
313 | $(CC) -o $(ECTEST) $(CFLAGS) $(ECTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
314 | fi | ||
315 | |||
316 | $(EXPTEST): $(EXPTEST).o $(DLIBCRYPTO) | ||
317 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
318 | $(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
319 | else \ | ||
320 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
321 | $(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
322 | fi | ||
323 | |||
324 | $(IDEATEST): $(IDEATEST).o $(DLIBCRYPTO) | ||
325 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
326 | $(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
327 | else \ | ||
328 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
329 | $(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
330 | fi | ||
331 | |||
332 | $(MD2TEST): $(MD2TEST).o $(DLIBCRYPTO) | ||
333 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
334 | $(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
335 | else \ | ||
336 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
337 | $(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
338 | fi | ||
339 | |||
340 | $(SHATEST): $(SHATEST).o $(DLIBCRYPTO) | ||
341 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
342 | $(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
343 | else \ | ||
344 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
345 | $(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
346 | fi | ||
347 | |||
348 | $(SHA1TEST): $(SHA1TEST).o $(DLIBCRYPTO) | ||
349 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
350 | $(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
351 | else \ | ||
352 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
353 | $(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
354 | fi | ||
355 | |||
356 | $(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO) | ||
357 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
358 | $(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
359 | else \ | ||
360 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
361 | $(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
362 | fi | ||
363 | |||
364 | $(MDC2TEST): $(MDC2TEST).o $(DLIBCRYPTO) | ||
365 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
366 | $(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
367 | else \ | ||
368 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
369 | $(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
370 | fi | ||
371 | |||
372 | $(MD4TEST): $(MD4TEST).o $(DLIBCRYPTO) | ||
373 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
374 | $(CC) -o $(MD4TEST) $(CFLAGS) $(MD4TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
375 | else \ | ||
376 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
377 | $(CC) -o $(MD4TEST) $(CFLAGS) $(MD4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
378 | fi | ||
379 | |||
380 | $(MD5TEST): $(MD5TEST).o $(DLIBCRYPTO) | ||
381 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
382 | $(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
383 | else \ | ||
384 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
385 | $(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
386 | fi | ||
387 | |||
388 | $(HMACTEST): $(HMACTEST).o $(DLIBCRYPTO) | ||
389 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
390 | $(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
391 | else \ | ||
392 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
393 | $(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
394 | fi | ||
395 | |||
396 | $(RC2TEST): $(RC2TEST).o $(DLIBCRYPTO) | ||
397 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
398 | $(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
399 | else \ | ||
400 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
401 | $(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
402 | fi | ||
403 | |||
404 | $(BFTEST): $(BFTEST).o $(DLIBCRYPTO) | ||
405 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
406 | $(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
407 | else \ | ||
408 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
409 | $(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
410 | fi | ||
411 | |||
412 | $(CASTTEST): $(CASTTEST).o $(DLIBCRYPTO) | ||
413 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
414 | $(CC) -o $(CASTTEST) $(CFLAGS) $(CASTTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
415 | else \ | ||
416 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
417 | $(CC) -o $(CASTTEST) $(CFLAGS) $(CASTTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
418 | fi | ||
419 | |||
420 | $(RC4TEST): $(RC4TEST).o $(DLIBCRYPTO) | ||
421 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
422 | $(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
423 | else \ | ||
424 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
425 | $(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
426 | fi | ||
427 | |||
428 | $(RC5TEST): $(RC5TEST).o $(DLIBCRYPTO) | ||
429 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
430 | $(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
431 | else \ | ||
432 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
433 | $(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
434 | fi | ||
435 | |||
436 | $(DESTEST): $(DESTEST).o $(DLIBCRYPTO) | ||
437 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
438 | $(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
439 | else \ | ||
440 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
441 | $(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
442 | fi | ||
443 | |||
444 | $(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO) | ||
445 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
446 | $(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
447 | else \ | ||
448 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
449 | $(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
450 | fi | ||
451 | |||
452 | $(DHTEST): $(DHTEST).o $(DLIBCRYPTO) | ||
453 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
454 | $(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
455 | else \ | ||
456 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
457 | $(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
458 | fi | ||
459 | |||
460 | $(DSATEST): $(DSATEST).o $(DLIBCRYPTO) | ||
461 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
462 | $(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
463 | else \ | ||
464 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
465 | $(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
466 | fi | ||
467 | |||
468 | $(METHTEST): $(METHTEST).o $(DLIBCRYPTO) | ||
469 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
470 | $(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
471 | else \ | ||
472 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
473 | $(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
474 | fi | ||
475 | |||
476 | $(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) | ||
477 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
478 | $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
479 | else \ | ||
480 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
481 | $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
482 | fi | ||
483 | |||
484 | $(ENGINETEST): $(ENGINETEST).o $(DLIBCRYPTO) | ||
485 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
486 | $(CC) -o $(ENGINETEST) $(CFLAGS) $(ENGINETEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
487 | else \ | ||
488 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
489 | $(CC) -o $(ENGINETEST) $(CFLAGS) $(ENGINETEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
490 | fi | ||
491 | |||
492 | $(EVPTEST): $(EVPTEST).o $(DLIBCRYPTO) | ||
493 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
494 | $(CC) -o $(EVPTEST) $(CFLAGS) $(EVPTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
495 | else \ | ||
496 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
497 | $(CC) -o $(EVPTEST) $(CFLAGS) $(EVPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
498 | fi | ||
499 | |||
500 | #$(AESTEST).o: $(AESTEST).c | ||
501 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c | ||
502 | |||
503 | #$(AESTEST): $(AESTEST).o $(DLIBCRYPTO) | ||
504 | # if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
505 | # $(CC) -o $(AESTEST) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
506 | # else \ | ||
507 | # LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
508 | # $(CC) -o $(AESTEST) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
509 | # fi | ||
510 | |||
511 | dummytest: dummytest.o $(DLIBCRYPTO) | ||
512 | if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
513 | $(CC) -o dummytest $(CFLAGS) dummytest.o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
514 | else \ | ||
515 | LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
516 | $(CC) -o dummytest $(CFLAGS) dummytest.o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
517 | fi | ||
518 | |||
519 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
520 | |||
521 | bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h | ||
522 | bftest.o: ../include/openssl/opensslconf.h bftest.c | ||
523 | bntest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
524 | bntest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
525 | bntest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
526 | bntest.o: ../include/openssl/cast.h ../include/openssl/crypto.h | ||
527 | bntest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
528 | bntest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
529 | bntest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
530 | bntest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
531 | bntest.o: ../include/openssl/lhash.h ../include/openssl/md2.h | ||
532 | bntest.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
533 | bntest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
534 | bntest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
535 | bntest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
536 | bntest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h | ||
537 | bntest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
538 | bntest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
539 | bntest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
540 | bntest.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
541 | bntest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
542 | bntest.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h | ||
543 | bntest.o: ../include/openssl/x509_vfy.h bntest.c | ||
544 | casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h | ||
545 | casttest.o: ../include/openssl/opensslconf.h casttest.c | ||
546 | destest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
547 | destest.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h | ||
548 | destest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
549 | destest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
550 | destest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
551 | destest.o: ../include/openssl/ui_compat.h destest.c | ||
552 | dhtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
553 | dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
554 | dhtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
555 | dhtest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
556 | dhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
557 | dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h | ||
558 | dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h dhtest.c | ||
559 | dsatest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
560 | dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
561 | dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
562 | dsatest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
563 | dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
564 | dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
565 | dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
566 | dsatest.o: ../include/openssl/symhacks.h dsatest.c | ||
567 | ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
568 | ectest.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
569 | ectest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
570 | ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
571 | ectest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
572 | ectest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
573 | ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
574 | ectest.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
575 | ectest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
576 | ectest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h ectest.c | ||
577 | enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h | ||
578 | enginetest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
579 | enginetest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
580 | enginetest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
581 | enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
582 | enginetest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
583 | enginetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
584 | enginetest.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
585 | enginetest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
586 | enginetest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
587 | enginetest.o: enginetest.c | ||
588 | evp_test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
589 | evp_test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
590 | evp_test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
591 | evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h | ||
592 | evp_test.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
593 | evp_test.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
594 | evp_test.o: ../include/openssl/e_os2.h ../include/openssl/engine.h | ||
595 | evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
596 | evp_test.o: ../include/openssl/idea.h ../include/openssl/lhash.h | ||
597 | evp_test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
598 | evp_test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
599 | evp_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
600 | evp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
601 | evp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
602 | evp_test.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
603 | evp_test.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
604 | evp_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
605 | evp_test.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
606 | evp_test.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
607 | evp_test.o: ../include/openssl/ui_compat.h evp_test.c | ||
608 | exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
609 | exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
610 | exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
611 | exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
612 | exptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
613 | exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
614 | exptest.o: ../include/openssl/symhacks.h exptest.c | ||
615 | hmactest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
616 | hmactest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
617 | hmactest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
618 | hmactest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
619 | hmactest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
620 | hmactest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
621 | hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h | ||
622 | hmactest.o: ../include/openssl/idea.h ../include/openssl/md2.h | ||
623 | hmactest.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
624 | hmactest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
625 | hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
626 | hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
627 | hmactest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
628 | hmactest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
629 | hmactest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
630 | hmactest.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
631 | hmactest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
632 | hmactest.o: ../include/openssl/ui_compat.h hmactest.c | ||
633 | ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h | ||
634 | ideatest.o: ../include/openssl/opensslconf.h ideatest.c | ||
635 | md2test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
636 | md2test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
637 | md2test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
638 | md2test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
639 | md2test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
640 | md2test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
641 | md2test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
642 | md2test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
643 | md2test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
644 | md2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
645 | md2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
646 | md2test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
647 | md2test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
648 | md2test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
649 | md2test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
650 | md2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
651 | md2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md2test.c | ||
652 | md4test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
653 | md4test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
654 | md4test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
655 | md4test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
656 | md4test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
657 | md4test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
658 | md4test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
659 | md4test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
660 | md4test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
661 | md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
662 | md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
663 | md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
664 | md4test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
665 | md4test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
666 | md4test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
667 | md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
668 | md4test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md4test.c | ||
669 | md5test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
670 | md5test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
671 | md5test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
672 | md5test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
673 | md5test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
674 | md5test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
675 | md5test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
676 | md5test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
677 | md5test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
678 | md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
679 | md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
680 | md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
681 | md5test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
682 | md5test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
683 | md5test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
684 | md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
685 | md5test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md5test.c | ||
686 | mdc2test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
687 | mdc2test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
688 | mdc2test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
689 | mdc2test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
690 | mdc2test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
691 | mdc2test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
692 | mdc2test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
693 | mdc2test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
694 | mdc2test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
695 | mdc2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
696 | mdc2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
697 | mdc2test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
698 | mdc2test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
699 | mdc2test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
700 | mdc2test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
701 | mdc2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
702 | mdc2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h mdc2test.c | ||
703 | randtest.o: ../e_os.h ../include/openssl/e_os2.h | ||
704 | randtest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h | ||
705 | randtest.o: ../include/openssl/rand.h randtest.c | ||
706 | rc2test.o: ../e_os.h ../include/openssl/e_os2.h | ||
707 | rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h rc2test.c | ||
708 | rc4test.o: ../e_os.h ../include/openssl/e_os2.h | ||
709 | rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h rc4test.c | ||
710 | rc5test.o: ../e_os.h ../include/openssl/e_os2.h | ||
711 | rc5test.o: ../include/openssl/opensslconf.h ../include/openssl/rc5.h rc5test.c | ||
712 | rmdtest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
713 | rmdtest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
714 | rmdtest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
715 | rmdtest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
716 | rmdtest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
717 | rmdtest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
718 | rmdtest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
719 | rmdtest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
720 | rmdtest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
721 | rmdtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
722 | rmdtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
723 | rmdtest.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
724 | rmdtest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
725 | rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
726 | rmdtest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
727 | rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
728 | rmdtest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h rmdtest.c | ||
729 | rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
730 | rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
731 | rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
732 | rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
733 | rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
734 | rsa_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
735 | rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
736 | rsa_test.o: ../include/openssl/symhacks.h rsa_test.c | ||
737 | sha1test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
738 | sha1test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
739 | sha1test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
740 | sha1test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
741 | sha1test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
742 | sha1test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
743 | sha1test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
744 | sha1test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
745 | sha1test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
746 | sha1test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
747 | sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
748 | sha1test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
749 | sha1test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
750 | sha1test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
751 | sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
752 | sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
753 | sha1test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h sha1test.c | ||
754 | shatest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
755 | shatest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
756 | shatest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
757 | shatest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
758 | shatest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
759 | shatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
760 | shatest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
761 | shatest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
762 | shatest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
763 | shatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
764 | shatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
765 | shatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
766 | shatest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
767 | shatest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
768 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
769 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
770 | shatest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h shatest.c | ||
771 | ssltest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
772 | ssltest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
773 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
774 | ssltest.o: ../include/openssl/cast.h ../include/openssl/comp.h | ||
775 | ssltest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
776 | ssltest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
777 | ssltest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
778 | ssltest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
779 | ssltest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
780 | ssltest.o: ../include/openssl/kssl.h ../include/openssl/lhash.h | ||
781 | ssltest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
782 | ssltest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
783 | ssltest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
784 | ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
785 | ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | ||
786 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | ||
787 | ssltest.o: ../include/openssl/rand.h ../include/openssl/rc2.h | ||
788 | ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
789 | ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
790 | ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
791 | ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | ||
792 | ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | ||
793 | ssltest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
794 | ssltest.o: ../include/openssl/tls1.h ../include/openssl/ui.h | ||
795 | ssltest.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h | ||
796 | ssltest.o: ../include/openssl/x509_vfy.h ssltest.c | ||
diff --git a/src/lib/libssl/test/dummytest.c b/src/lib/libssl/test/dummytest.c new file mode 100644 index 0000000000..5b4467e042 --- /dev/null +++ b/src/lib/libssl/test/dummytest.c | |||
@@ -0,0 +1,48 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | #include <ctype.h> | ||
5 | #include <openssl/e_os2.h> | ||
6 | #include <openssl/buffer.h> | ||
7 | #include <openssl/crypto.h> | ||
8 | |||
9 | int main(int argc, char *argv[]) | ||
10 | { | ||
11 | char *p, *q = 0, *program; | ||
12 | |||
13 | p = strrchr(argv[0], '/'); | ||
14 | if (!p) p = strrchr(argv[0], '\\'); | ||
15 | #ifdef OPENSSL_SYS_VMS | ||
16 | if (!p) p = strrchr(argv[0], ']'); | ||
17 | if (p) q = strrchr(p, '>'); | ||
18 | if (q) p = q; | ||
19 | if (!p) p = strrchr(argv[0], ':'); | ||
20 | q = 0; | ||
21 | #endif | ||
22 | if (p) p++; | ||
23 | if (!p) p = argv[0]; | ||
24 | if (p) q = strchr(p, '.'); | ||
25 | if (p && !q) q = p + strlen(p); | ||
26 | |||
27 | if (!p) | ||
28 | program = BUF_strdup("(unknown)"); | ||
29 | else | ||
30 | { | ||
31 | program = OPENSSL_malloc((q - p) + 1); | ||
32 | strncpy(program, p, q - p); | ||
33 | program[q - p] = '\0'; | ||
34 | } | ||
35 | |||
36 | for(p = program; *p; p++) | ||
37 | if (islower((unsigned char)(*p))) | ||
38 | *p = toupper((unsigned char)(*p)); | ||
39 | |||
40 | q = strstr(program, "TEST"); | ||
41 | if (q > p && q[-1] == '_') q--; | ||
42 | *q = '\0'; | ||
43 | |||
44 | printf("No %s support\n", program); | ||
45 | |||
46 | OPENSSL_free(program); | ||
47 | return(0); | ||
48 | } | ||
diff --git a/src/lib/libssl/test/enginetest.c b/src/lib/libssl/test/enginetest.c new file mode 100644 index 0000000000..87fa8c57b7 --- /dev/null +++ b/src/lib/libssl/test/enginetest.c | |||
@@ -0,0 +1,274 @@ | |||
1 | /* crypto/engine/enginetest.c */ | ||
2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <openssl/e_os2.h> | ||
60 | #include <stdio.h> | ||
61 | #include <string.h> | ||
62 | #include <openssl/buffer.h> | ||
63 | #include <openssl/crypto.h> | ||
64 | #include <openssl/engine.h> | ||
65 | #include <openssl/err.h> | ||
66 | |||
67 | static void display_engine_list() | ||
68 | { | ||
69 | ENGINE *h; | ||
70 | int loop; | ||
71 | |||
72 | h = ENGINE_get_first(); | ||
73 | loop = 0; | ||
74 | printf("listing available engine types\n"); | ||
75 | while(h) | ||
76 | { | ||
77 | printf("engine %i, id = \"%s\", name = \"%s\"\n", | ||
78 | loop++, ENGINE_get_id(h), ENGINE_get_name(h)); | ||
79 | h = ENGINE_get_next(h); | ||
80 | } | ||
81 | printf("end of list\n"); | ||
82 | /* ENGINE_get_first() increases the struct_ref counter, so we | ||
83 | must call ENGINE_free() to decrease it again */ | ||
84 | ENGINE_free(h); | ||
85 | } | ||
86 | |||
87 | int main(int argc, char *argv[]) | ||
88 | { | ||
89 | ENGINE *block[512]; | ||
90 | char buf[256]; | ||
91 | const char *id, *name; | ||
92 | ENGINE *ptr; | ||
93 | int loop; | ||
94 | int to_return = 1; | ||
95 | ENGINE *new_h1 = NULL; | ||
96 | ENGINE *new_h2 = NULL; | ||
97 | ENGINE *new_h3 = NULL; | ||
98 | ENGINE *new_h4 = NULL; | ||
99 | |||
100 | /* enable memory leak checking unless explicitly disabled */ | ||
101 | if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))) | ||
102 | { | ||
103 | CRYPTO_malloc_debug_init(); | ||
104 | CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); | ||
105 | } | ||
106 | else | ||
107 | { | ||
108 | /* OPENSSL_DEBUG_MEMORY=off */ | ||
109 | CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0); | ||
110 | } | ||
111 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
112 | ERR_load_crypto_strings(); | ||
113 | |||
114 | memset(block, 0, 512 * sizeof(ENGINE *)); | ||
115 | if(((new_h1 = ENGINE_new()) == NULL) || | ||
116 | !ENGINE_set_id(new_h1, "test_id0") || | ||
117 | !ENGINE_set_name(new_h1, "First test item") || | ||
118 | ((new_h2 = ENGINE_new()) == NULL) || | ||
119 | !ENGINE_set_id(new_h2, "test_id1") || | ||
120 | !ENGINE_set_name(new_h2, "Second test item") || | ||
121 | ((new_h3 = ENGINE_new()) == NULL) || | ||
122 | !ENGINE_set_id(new_h3, "test_id2") || | ||
123 | !ENGINE_set_name(new_h3, "Third test item") || | ||
124 | ((new_h4 = ENGINE_new()) == NULL) || | ||
125 | !ENGINE_set_id(new_h4, "test_id3") || | ||
126 | !ENGINE_set_name(new_h4, "Fourth test item")) | ||
127 | { | ||
128 | printf("Couldn't set up test ENGINE structures\n"); | ||
129 | goto end; | ||
130 | } | ||
131 | printf("\nenginetest beginning\n\n"); | ||
132 | display_engine_list(); | ||
133 | if(!ENGINE_add(new_h1)) | ||
134 | { | ||
135 | printf("Add failed!\n"); | ||
136 | goto end; | ||
137 | } | ||
138 | display_engine_list(); | ||
139 | ptr = ENGINE_get_first(); | ||
140 | if(!ENGINE_remove(ptr)) | ||
141 | { | ||
142 | printf("Remove failed!\n"); | ||
143 | goto end; | ||
144 | } | ||
145 | if (ptr) | ||
146 | ENGINE_free(ptr); | ||
147 | display_engine_list(); | ||
148 | if(!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) | ||
149 | { | ||
150 | printf("Add failed!\n"); | ||
151 | goto end; | ||
152 | } | ||
153 | display_engine_list(); | ||
154 | if(!ENGINE_remove(new_h2)) | ||
155 | { | ||
156 | printf("Remove failed!\n"); | ||
157 | goto end; | ||
158 | } | ||
159 | display_engine_list(); | ||
160 | if(!ENGINE_add(new_h4)) | ||
161 | { | ||
162 | printf("Add failed!\n"); | ||
163 | goto end; | ||
164 | } | ||
165 | display_engine_list(); | ||
166 | if(ENGINE_add(new_h3)) | ||
167 | { | ||
168 | printf("Add *should* have failed but didn't!\n"); | ||
169 | goto end; | ||
170 | } | ||
171 | else | ||
172 | printf("Add that should fail did.\n"); | ||
173 | ERR_clear_error(); | ||
174 | if(ENGINE_remove(new_h2)) | ||
175 | { | ||
176 | printf("Remove *should* have failed but didn't!\n"); | ||
177 | goto end; | ||
178 | } | ||
179 | else | ||
180 | printf("Remove that should fail did.\n"); | ||
181 | ERR_clear_error(); | ||
182 | if(!ENGINE_remove(new_h3)) | ||
183 | { | ||
184 | printf("Remove failed!\n"); | ||
185 | goto end; | ||
186 | } | ||
187 | display_engine_list(); | ||
188 | if(!ENGINE_remove(new_h4)) | ||
189 | { | ||
190 | printf("Remove failed!\n"); | ||
191 | goto end; | ||
192 | } | ||
193 | display_engine_list(); | ||
194 | /* Depending on whether there's any hardware support compiled | ||
195 | * in, this remove may be destined to fail. */ | ||
196 | ptr = ENGINE_get_first(); | ||
197 | if(ptr) | ||
198 | if(!ENGINE_remove(ptr)) | ||
199 | printf("Remove failed!i - probably no hardware " | ||
200 | "support present.\n"); | ||
201 | if (ptr) | ||
202 | ENGINE_free(ptr); | ||
203 | display_engine_list(); | ||
204 | if(!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) | ||
205 | { | ||
206 | printf("Couldn't add and remove to an empty list!\n"); | ||
207 | goto end; | ||
208 | } | ||
209 | else | ||
210 | printf("Successfully added and removed to an empty list!\n"); | ||
211 | printf("About to beef up the engine-type list\n"); | ||
212 | for(loop = 0; loop < 512; loop++) | ||
213 | { | ||
214 | sprintf(buf, "id%i", loop); | ||
215 | id = BUF_strdup(buf); | ||
216 | sprintf(buf, "Fake engine type %i", loop); | ||
217 | name = BUF_strdup(buf); | ||
218 | if(((block[loop] = ENGINE_new()) == NULL) || | ||
219 | !ENGINE_set_id(block[loop], id) || | ||
220 | !ENGINE_set_name(block[loop], name)) | ||
221 | { | ||
222 | printf("Couldn't create block of ENGINE structures.\n" | ||
223 | "I'll probably also core-dump now, damn.\n"); | ||
224 | goto end; | ||
225 | } | ||
226 | } | ||
227 | for(loop = 0; loop < 512; loop++) | ||
228 | { | ||
229 | if(!ENGINE_add(block[loop])) | ||
230 | { | ||
231 | printf("\nAdding stopped at %i, (%s,%s)\n", | ||
232 | loop, ENGINE_get_id(block[loop]), | ||
233 | ENGINE_get_name(block[loop])); | ||
234 | goto cleanup_loop; | ||
235 | } | ||
236 | else | ||
237 | printf("."); fflush(stdout); | ||
238 | } | ||
239 | cleanup_loop: | ||
240 | printf("\nAbout to empty the engine-type list\n"); | ||
241 | while((ptr = ENGINE_get_first()) != NULL) | ||
242 | { | ||
243 | if(!ENGINE_remove(ptr)) | ||
244 | { | ||
245 | printf("\nRemove failed!\n"); | ||
246 | goto end; | ||
247 | } | ||
248 | ENGINE_free(ptr); | ||
249 | printf("."); fflush(stdout); | ||
250 | } | ||
251 | for(loop = 0; loop < 512; loop++) | ||
252 | { | ||
253 | OPENSSL_free((void *)ENGINE_get_id(block[loop])); | ||
254 | OPENSSL_free((void *)ENGINE_get_name(block[loop])); | ||
255 | } | ||
256 | printf("\nTests completed happily\n"); | ||
257 | to_return = 0; | ||
258 | end: | ||
259 | if(to_return) | ||
260 | ERR_print_errors_fp(stderr); | ||
261 | if(new_h1) ENGINE_free(new_h1); | ||
262 | if(new_h2) ENGINE_free(new_h2); | ||
263 | if(new_h3) ENGINE_free(new_h3); | ||
264 | if(new_h4) ENGINE_free(new_h4); | ||
265 | for(loop = 0; loop < 512; loop++) | ||
266 | if(block[loop]) | ||
267 | ENGINE_free(block[loop]); | ||
268 | ENGINE_cleanup(); | ||
269 | CRYPTO_cleanup_all_ex_data(); | ||
270 | ERR_free_strings(); | ||
271 | ERR_remove_state(0); | ||
272 | CRYPTO_mem_leaks_fp(stderr); | ||
273 | return to_return; | ||
274 | } | ||
diff --git a/src/lib/libssl/test/evptests.txt b/src/lib/libssl/test/evptests.txt new file mode 100644 index 0000000000..80bd9c7765 --- /dev/null +++ b/src/lib/libssl/test/evptests.txt | |||
@@ -0,0 +1,183 @@ | |||
1 | #cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt) | ||
2 | #digest:::input:output | ||
3 | |||
4 | # SHA(1) tests (from shatest.c) | ||
5 | SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d | ||
6 | |||
7 | # MD5 tests (from md5test.c) | ||
8 | MD5::::d41d8cd98f00b204e9800998ecf8427e | ||
9 | MD5:::61:0cc175b9c0f1b6a831c399e269772661 | ||
10 | MD5:::616263:900150983cd24fb0d6963f7d28e17f72 | ||
11 | MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0 | ||
12 | MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b | ||
13 | MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f | ||
14 | MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a | ||
15 | |||
16 | # AES 128 ECB tests (from FIPS-197 test vectors, encrypt) | ||
17 | |||
18 | AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A:1 | ||
19 | |||
20 | # AES 192 ECB tests (from FIPS-197 test vectors, encrypt) | ||
21 | |||
22 | AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191:1 | ||
23 | |||
24 | # AES 256 ECB tests (from FIPS-197 test vectors, encrypt) | ||
25 | |||
26 | AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089:1 | ||
27 | |||
28 | # AES 128 ECB tests (from NIST test vectors, encrypt) | ||
29 | |||
30 | #AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F:1 | ||
31 | |||
32 | # AES 128 ECB tests (from NIST test vectors, decrypt) | ||
33 | |||
34 | #AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000:0 | ||
35 | |||
36 | # AES 192 ECB tests (from NIST test vectors, decrypt) | ||
37 | |||
38 | #AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000:0 | ||
39 | |||
40 | # AES 256 ECB tests (from NIST test vectors, decrypt) | ||
41 | |||
42 | #AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000:0 | ||
43 | |||
44 | # AES 128 CBC tests (from NIST test vectors, encrypt) | ||
45 | |||
46 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1 | ||
47 | |||
48 | # AES 192 CBC tests (from NIST test vectors, encrypt) | ||
49 | |||
50 | #AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1 | ||
51 | |||
52 | # AES 256 CBC tests (from NIST test vectors, encrypt) | ||
53 | |||
54 | #AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1 | ||
55 | |||
56 | # AES 128 CBC tests (from NIST test vectors, decrypt) | ||
57 | |||
58 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0 | ||
59 | |||
60 | # AES tests from NIST document SP800-38A | ||
61 | # For all ECB encrypts and decrypts, the transformed sequence is | ||
62 | # AES-bits-ECB:key::plaintext:ciphertext:encdec | ||
63 | # ECB-AES128.Encrypt and ECB-AES128.Decrypt | ||
64 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3AD77BB40D7A3660A89ECAF32466EF97 | ||
65 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF | ||
66 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688 | ||
67 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4 | ||
68 | # ECB-AES192.Encrypt and ECB-AES192.Decrypt | ||
69 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC | ||
70 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF | ||
71 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E | ||
72 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E | ||
73 | # ECB-AES256.Encrypt and ECB-AES256.Decrypt | ||
74 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8 | ||
75 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870 | ||
76 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D | ||
77 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7 | ||
78 | # For all CBC encrypts and decrypts, the transformed sequence is | ||
79 | # AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
80 | # CBC-AES128.Encrypt and CBC-AES128.Decrypt | ||
81 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D | ||
82 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2 | ||
83 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516 | ||
84 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7 | ||
85 | # CBC-AES192.Encrypt and CBC-AES192.Decrypt | ||
86 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8 | ||
87 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A | ||
88 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0 | ||
89 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD | ||
90 | # CBC-AES256.Encrypt and CBC-AES256.Decrypt | ||
91 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6 | ||
92 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D | ||
93 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461 | ||
94 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B | ||
95 | # We don't support CFB{1,8}-AESxxx.{En,De}crypt | ||
96 | # For all CFB128 encrypts and decrypts, the transformed sequence is | ||
97 | # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
98 | # CFB128-AES128.Encrypt | ||
99 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
100 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 | ||
101 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 | ||
102 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 | ||
103 | # CFB128-AES128.Decrypt | ||
104 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
105 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 | ||
106 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 | ||
107 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0 | ||
108 | # CFB128-AES192.Encrypt | ||
109 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
110 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1 | ||
111 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1 | ||
112 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1 | ||
113 | # CFB128-AES192.Decrypt | ||
114 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
115 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 | ||
116 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 | ||
117 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 | ||
118 | # CFB128-AES256.Encrypt | ||
119 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
120 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 | ||
121 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 | ||
122 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 | ||
123 | # CFB128-AES256.Decrypt | ||
124 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
125 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 | ||
126 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 | ||
127 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 | ||
128 | # For all OFB encrypts and decrypts, the transformed sequence is | ||
129 | # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec | ||
130 | # OFB-AES128.Encrypt | ||
131 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
132 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 | ||
133 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 | ||
134 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 | ||
135 | # OFB-AES128.Decrypt | ||
136 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
137 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 | ||
138 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 | ||
139 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 | ||
140 | # OFB-AES192.Encrypt | ||
141 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
142 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 | ||
143 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 | ||
144 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 | ||
145 | # OFB-AES192.Decrypt | ||
146 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
147 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 | ||
148 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 | ||
149 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 | ||
150 | # OFB-AES256.Encrypt | ||
151 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
152 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 | ||
153 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 | ||
154 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 | ||
155 | # OFB-AES256.Decrypt | ||
156 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
157 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 | ||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | ||
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | ||
160 | |||
161 | # DES ECB tests (from destest) | ||
162 | |||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | ||
164 | DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58 | ||
165 | DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B | ||
166 | DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533 | ||
167 | DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D | ||
168 | DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD | ||
169 | DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4 | ||
170 | |||
171 | # DESX-CBC tests (from destest) | ||
172 | DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4 | ||
173 | |||
174 | # DES EDE3 CBC tests (from destest) | ||
175 | DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675 | ||
176 | |||
177 | # RC4 tests (from rc4test) | ||
178 | RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596 | ||
179 | RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879 | ||
180 | RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a | ||
181 | RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858 | ||
182 | RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf | ||
183 | RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61 | ||
diff --git a/src/lib/libssl/test/maketests.com b/src/lib/libssl/test/maketests.com new file mode 100644 index 0000000000..7c44e4545a --- /dev/null +++ b/src/lib/libssl/test/maketests.com | |||
@@ -0,0 +1,913 @@ | |||
1 | $! | ||
2 | $! MAKETESTS.COM | ||
3 | $! Written By: Robert Byer | ||
4 | $! Vice-President | ||
5 | $! A-Com Computing, Inc. | ||
6 | $! byer@mail.all-net.net | ||
7 | $! | ||
8 | $! Changes by Richard Levitte <richard@levitte.org> | ||
9 | $! | ||
10 | $! This command files compiles and creates all the various different | ||
11 | $! "test" programs for the different types of encryption for OpenSSL. | ||
12 | $! It was written so it would try to determine what "C" compiler to | ||
13 | $! use or you can specify which "C" compiler to use. | ||
14 | $! | ||
15 | $! The test "executeables" will be placed in a directory called | ||
16 | $! [.xxx.EXE.TEST] where "xxx" denotes AXP or VAX depending on your machines | ||
17 | $! architecture. | ||
18 | $! | ||
19 | $! Specify DEBUG or NODEBUG P1 to compile with or without debugger | ||
20 | $! information. | ||
21 | $! | ||
22 | $! Specify which compiler at P2 to try to compile under. | ||
23 | $! | ||
24 | $! VAXC For VAX C. | ||
25 | $! DECC For DEC C. | ||
26 | $! GNUC For GNU C. | ||
27 | $! | ||
28 | $! If you don't speficy a compiler, it will try to determine which | ||
29 | $! "C" compiler to use. | ||
30 | $! | ||
31 | $! P3, if defined, sets a TCP/IP library to use, through one of the following | ||
32 | $! keywords: | ||
33 | $! | ||
34 | $! UCX for UCX | ||
35 | $! SOCKETSHR for SOCKETSHR+NETLIB | ||
36 | $! | ||
37 | $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) | ||
38 | $! | ||
39 | $! | ||
40 | $! Define A TCP/IP Library That We Will Need To Link To. | ||
41 | $! (That is, If Wee Need To Link To One.) | ||
42 | $! | ||
43 | $ TCPIP_LIB = "" | ||
44 | $! | ||
45 | $! Check Which Architecture We Are Using. | ||
46 | $! | ||
47 | $ IF (F$GETSYI("CPU").GE.128) | ||
48 | $ THEN | ||
49 | $! | ||
50 | $! The Architecture Is AXP. | ||
51 | $! | ||
52 | $ ARCH := AXP | ||
53 | $! | ||
54 | $! Else... | ||
55 | $! | ||
56 | $ ELSE | ||
57 | $! | ||
58 | $! The Architecture Is VAX. | ||
59 | $! | ||
60 | $ ARCH := VAX | ||
61 | $! | ||
62 | $! End The Architecture Check. | ||
63 | $! | ||
64 | $ ENDIF | ||
65 | $! | ||
66 | $! Check To Make Sure We Have Valid Command Line Parameters. | ||
67 | $! | ||
68 | $ GOSUB CHECK_OPTIONS | ||
69 | $! | ||
70 | $! Initialise logical names and such | ||
71 | $! | ||
72 | $ GOSUB INITIALISE | ||
73 | $! | ||
74 | $! Tell The User What Kind of Machine We Run On. | ||
75 | $! | ||
76 | $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." | ||
77 | $! | ||
78 | $! Define The CRYPTO-LIB We Are To Use. | ||
79 | $! | ||
80 | $ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB | ||
81 | $! | ||
82 | $! Define The SSL We Are To Use. | ||
83 | $! | ||
84 | $ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB | ||
85 | $! | ||
86 | $! Define The OBJ Directory. | ||
87 | $! | ||
88 | $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST] | ||
89 | $! | ||
90 | $! Check To See If The Architecture Specific OBJ Directory Exists. | ||
91 | $! | ||
92 | $ IF (F$PARSE(OBJ_DIR).EQS."") | ||
93 | $ THEN | ||
94 | $! | ||
95 | $! The EXE Directory Dosen't Exist, So Create It. | ||
96 | $! | ||
97 | $ CREATE/DIRECTORY 'OBJ_DIR' | ||
98 | $! | ||
99 | $! End The Architecture Specific OBJ Directory Check. | ||
100 | $! | ||
101 | $ ENDIF | ||
102 | $! | ||
103 | $! Define The EXE Directory. | ||
104 | $! | ||
105 | $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST] | ||
106 | $! | ||
107 | $! Check To See If The Architecture Specific EXE Directory Exists. | ||
108 | $! | ||
109 | $ IF (F$PARSE(EXE_DIR).EQS."") | ||
110 | $ THEN | ||
111 | $! | ||
112 | $! The EXE Directory Dosen't Exist, So Create It. | ||
113 | $! | ||
114 | $ CREATE/DIRECTORY 'EXE_DIR' | ||
115 | $! | ||
116 | $! End The Architecture Specific EXE Directory Check. | ||
117 | $! | ||
118 | $ ENDIF | ||
119 | $! | ||
120 | $! Check To See If We Have The Proper Libraries. | ||
121 | $! | ||
122 | $ GOSUB LIB_CHECK | ||
123 | $! | ||
124 | $! Check To See If We Have A Linker Option File. | ||
125 | $! | ||
126 | $ GOSUB CHECK_OPT_FILE | ||
127 | $! | ||
128 | $! Define The TEST Files. | ||
129 | $! | ||
130 | $ TEST_FILES = "BNTEST,ECTEST,IDEATEST,MD2TEST,MD4TEST,MD5TEST,HMACTEST,"+ - | ||
131 | "RC2TEST,RC4TEST,RC5TEST,"+ - | ||
132 | "DESTEST,SHATEST,SHA1TEST,MDC2TEST,RMDTEST,"+ - | ||
133 | "RANDTEST,DHTEST,ENGINETEST,"+ - | ||
134 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - | ||
135 | "EVP_TEST" | ||
136 | $ TCPIP_PROGRAMS = ",," | ||
137 | $ IF COMPILER .EQS. "VAXC" THEN - | ||
138 | TCPIP_PROGRAMS = ",SSLTEST," | ||
139 | $! | ||
140 | $! Define A File Counter And Set It To "0". | ||
141 | $! | ||
142 | $ FILE_COUNTER = 0 | ||
143 | $! | ||
144 | $! Top Of The File Loop. | ||
145 | $! | ||
146 | $ NEXT_FILE: | ||
147 | $! | ||
148 | $! O.K, Extract The File Name From The File List. | ||
149 | $! | ||
150 | $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES) | ||
151 | $! | ||
152 | $! Check To See If We Are At The End Of The File List. | ||
153 | $! | ||
154 | $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE | ||
155 | $! | ||
156 | $! Increment The Counter. | ||
157 | $! | ||
158 | $ FILE_COUNTER = FILE_COUNTER + 1 | ||
159 | $! | ||
160 | $! Create The Source File Name. | ||
161 | $! | ||
162 | $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" | ||
163 | $! | ||
164 | $! Create The Object File Name. | ||
165 | $! | ||
166 | $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" | ||
167 | $! | ||
168 | $! Create The Executable File Name. | ||
169 | $! | ||
170 | $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" | ||
171 | $ ON WARNING THEN GOTO NEXT_FILE | ||
172 | $! | ||
173 | $! Check To See If The File We Want To Compile Actually Exists. | ||
174 | $! | ||
175 | $ IF (F$SEARCH(SOURCE_FILE).EQS."") | ||
176 | $ THEN | ||
177 | $! | ||
178 | $! Tell The User That The File Dosen't Exist. | ||
179 | $! | ||
180 | $ WRITE SYS$OUTPUT "" | ||
181 | $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." | ||
182 | $ WRITE SYS$OUTPUT "" | ||
183 | $! | ||
184 | $! Exit The Build. | ||
185 | $! | ||
186 | $ GOTO EXIT | ||
187 | $ ENDIF | ||
188 | $! | ||
189 | $! Tell The User What We Are Building. | ||
190 | $! | ||
191 | $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program." | ||
192 | $! | ||
193 | $! Compile The File. | ||
194 | $! | ||
195 | $ ON ERROR THEN GOTO NEXT_FILE | ||
196 | $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | ||
197 | $ ON WARNING THEN GOTO NEXT_FILE | ||
198 | $! | ||
199 | $! Check If What We Are About To Compile Works Without A TCP/IP Library. | ||
200 | $! | ||
201 | $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS)) | ||
202 | $ THEN | ||
203 | $! | ||
204 | $! Inform The User That A TCP/IP Library Is Needed To Compile This Program. | ||
205 | $! | ||
206 | $ WRITE SYS$OUTPUT FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..." | ||
207 | $ GOTO NEXT_FILE | ||
208 | $! | ||
209 | $! End The TCP/IP Library Check. | ||
210 | $! | ||
211 | $ ENDIF | ||
212 | $! | ||
213 | $! Link The Program, Check To See If We Need To Link With RSAREF Or Not. | ||
214 | $! Check To See If We Are To Link With A Specific TCP/IP Library. | ||
215 | $! | ||
216 | $ IF (TCPIP_LIB.NES."") | ||
217 | $ THEN | ||
218 | $! | ||
219 | $! Don't Link With The RSAREF Routines And TCP/IP Library. | ||
220 | $! | ||
221 | $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - | ||
222 | 'OBJECT_FILE', - | ||
223 | 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - | ||
224 | 'TCPIP_LIB','OPT_FILE'/OPTION | ||
225 | $! | ||
226 | $! Else... | ||
227 | $! | ||
228 | $ ELSE | ||
229 | $! | ||
230 | $! Don't Link With The RSAREF Routines And Link With A TCP/IP Library. | ||
231 | $! | ||
232 | $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - | ||
233 | 'OBJECT_FILE', - | ||
234 | 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - | ||
235 | 'OPT_FILE'/OPTION | ||
236 | $! | ||
237 | $! End The TCP/IP Library Check. | ||
238 | $! | ||
239 | $ ENDIF | ||
240 | $! | ||
241 | $! Go Back And Do It Again. | ||
242 | $! | ||
243 | $ GOTO NEXT_FILE | ||
244 | $! | ||
245 | $! All Done With This Library Part. | ||
246 | $! | ||
247 | $ FILE_DONE: | ||
248 | $! | ||
249 | $! All Done, Time To Exit. | ||
250 | $! | ||
251 | $ EXIT: | ||
252 | $ GOSUB CLEANUP | ||
253 | $ EXIT | ||
254 | $! | ||
255 | $! Check For The Link Option FIle. | ||
256 | $! | ||
257 | $ CHECK_OPT_FILE: | ||
258 | $! | ||
259 | $! Check To See If We Need To Make A VAX C Option File. | ||
260 | $! | ||
261 | $ IF (COMPILER.EQS."VAXC") | ||
262 | $ THEN | ||
263 | $! | ||
264 | $! Check To See If We Already Have A VAX C Linker Option File. | ||
265 | $! | ||
266 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
267 | $ THEN | ||
268 | $! | ||
269 | $! We Need A VAX C Linker Option File. | ||
270 | $! | ||
271 | $ CREATE 'OPT_FILE' | ||
272 | $DECK | ||
273 | ! | ||
274 | ! Default System Options File To Link Agianst | ||
275 | ! The Sharable VAX C Runtime Library. | ||
276 | ! | ||
277 | SYS$SHARE:VAXCRTL.EXE/SHARE | ||
278 | $EOD | ||
279 | $! | ||
280 | $! End The Option File Check. | ||
281 | $! | ||
282 | $ ENDIF | ||
283 | $! | ||
284 | $! End The VAXC Check. | ||
285 | $! | ||
286 | $ ENDIF | ||
287 | $! | ||
288 | $! Check To See If We Need A GNU C Option File. | ||
289 | $! | ||
290 | $ IF (COMPILER.EQS."GNUC") | ||
291 | $ THEN | ||
292 | $! | ||
293 | $! Check To See If We Already Have A GNU C Linker Option File. | ||
294 | $! | ||
295 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
296 | $ THEN | ||
297 | $! | ||
298 | $! We Need A GNU C Linker Option File. | ||
299 | $! | ||
300 | $ CREATE 'OPT_FILE' | ||
301 | $DECK | ||
302 | ! | ||
303 | ! Default System Options File To Link Agianst | ||
304 | ! The Sharable C Runtime Library. | ||
305 | ! | ||
306 | GNU_CC:[000000]GCCLIB/LIBRARY | ||
307 | SYS$SHARE:VAXCRTL/SHARE | ||
308 | $EOD | ||
309 | $! | ||
310 | $! End The Option File Check. | ||
311 | $! | ||
312 | $ ENDIF | ||
313 | $! | ||
314 | $! End The GNU C Check. | ||
315 | $! | ||
316 | $ ENDIF | ||
317 | $! | ||
318 | $! Check To See If We Need A DEC C Option File. | ||
319 | $! | ||
320 | $ IF (COMPILER.EQS."DECC") | ||
321 | $ THEN | ||
322 | $! | ||
323 | $! Check To See If We Already Have A DEC C Linker Option File. | ||
324 | $! | ||
325 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
326 | $ THEN | ||
327 | $! | ||
328 | $! Figure Out If We Need An AXP Or A VAX Linker Option File. | ||
329 | $! | ||
330 | $ IF (ARCH.EQS."VAX") | ||
331 | $ THEN | ||
332 | $! | ||
333 | $! We Need A DEC C Linker Option File For VAX. | ||
334 | $! | ||
335 | $ CREATE 'OPT_FILE' | ||
336 | $DECK | ||
337 | ! | ||
338 | ! Default System Options File To Link Agianst | ||
339 | ! The Sharable DEC C Runtime Library. | ||
340 | ! | ||
341 | SYS$SHARE:DECC$SHR.EXE/SHARE | ||
342 | $EOD | ||
343 | $! | ||
344 | $! Else... | ||
345 | $! | ||
346 | $ ELSE | ||
347 | $! | ||
348 | $! Create The AXP Linker Option File. | ||
349 | $! | ||
350 | $ CREATE 'OPT_FILE' | ||
351 | $DECK | ||
352 | ! | ||
353 | ! Default System Options File For AXP To Link Agianst | ||
354 | ! The Sharable C Runtime Library. | ||
355 | ! | ||
356 | SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE | ||
357 | SYS$SHARE:CMA$OPEN_RTL/SHARE | ||
358 | $EOD | ||
359 | $! | ||
360 | $! End The VAX/AXP DEC C Option File Check. | ||
361 | $! | ||
362 | $ ENDIF | ||
363 | $! | ||
364 | $! End The Option File Search. | ||
365 | $! | ||
366 | $ ENDIF | ||
367 | $! | ||
368 | $! End The DEC C Check. | ||
369 | $! | ||
370 | $ ENDIF | ||
371 | $! | ||
372 | $! Tell The User What Linker Option File We Are Using. | ||
373 | $! | ||
374 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." | ||
375 | $! | ||
376 | $! Time To RETURN. | ||
377 | $! | ||
378 | $ RETURN | ||
379 | $! | ||
380 | $! Check To See If We Have The Appropiate Libraries. | ||
381 | $! | ||
382 | $ LIB_CHECK: | ||
383 | $! | ||
384 | $! Look For The Library LIBCRYPTO.OLB. | ||
385 | $! | ||
386 | $ IF (F$SEARCH(CRYPTO_LIB).EQS."") | ||
387 | $ THEN | ||
388 | $! | ||
389 | $! Tell The User We Can't Find The LIBCRYPTO.OLB Library. | ||
390 | $! | ||
391 | $ WRITE SYS$OUTPUT "" | ||
392 | $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." | ||
393 | $ WRITE SYS$OUTPUT "We Can't Link Without It." | ||
394 | $ WRITE SYS$OUTPUT "" | ||
395 | $! | ||
396 | $! Since We Can't Link Without It, Exit. | ||
397 | $! | ||
398 | $ EXIT | ||
399 | $! | ||
400 | $! End The Crypto Library Check. | ||
401 | $! | ||
402 | $ ENDIF | ||
403 | $! | ||
404 | $! Look For The Library LIBSSL.OLB. | ||
405 | $! | ||
406 | $ IF (F$SEARCH(SSL_LIB).EQS."") | ||
407 | $ THEN | ||
408 | $! | ||
409 | $! Tell The User We Can't Find The LIBSSL.OLB Library. | ||
410 | $! | ||
411 | $ WRITE SYS$OUTPUT "" | ||
412 | $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." | ||
413 | $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It." | ||
414 | $ WRITE SYS$OUTPUT "" | ||
415 | $! | ||
416 | $! Since We Can't Link Without It, Exit. | ||
417 | $! | ||
418 | $ EXIT | ||
419 | $! | ||
420 | $! End The SSL Library Check. | ||
421 | $! | ||
422 | $ ENDIF | ||
423 | $! | ||
424 | $! Time To Return. | ||
425 | $! | ||
426 | $ RETURN | ||
427 | $! | ||
428 | $! Check The User's Options. | ||
429 | $! | ||
430 | $ CHECK_OPTIONS: | ||
431 | $! | ||
432 | $! Check To See If P1 Is Blank. | ||
433 | $! | ||
434 | $ IF (P1.EQS."NODEBUG") | ||
435 | $ THEN | ||
436 | $! | ||
437 | $! P1 Is NODEBUG, So Compile Without Debugger Information. | ||
438 | $! | ||
439 | $ DEBUGGER = "NODEBUG" | ||
440 | $ TRACEBACK = "NOTRACEBACK" | ||
441 | $ GCC_OPTIMIZE = "OPTIMIZE" | ||
442 | $ CC_OPTIMIZE = "OPTIMIZE" | ||
443 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." | ||
444 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | ||
445 | $! | ||
446 | $! Else... | ||
447 | $! | ||
448 | $ ELSE | ||
449 | $! | ||
450 | $! Check To See If We Are To Compile With Debugger Information. | ||
451 | $! | ||
452 | $ IF (P1.EQS."DEBUG") | ||
453 | $ THEN | ||
454 | $! | ||
455 | $! Compile With Debugger Information. | ||
456 | $! | ||
457 | $ DEBUGGER = "DEBUG" | ||
458 | $ TRACEBACK = "TRACEBACK" | ||
459 | $ GCC_OPTIMIZE = "NOOPTIMIZE" | ||
460 | $ CC_OPTIMIZE = "NOOPTIMIZE" | ||
461 | $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." | ||
462 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." | ||
463 | $! | ||
464 | $! Else... | ||
465 | $! | ||
466 | $ ELSE | ||
467 | $! | ||
468 | $! Tell The User Entered An Invalid Option.. | ||
469 | $! | ||
470 | $ WRITE SYS$OUTPUT "" | ||
471 | $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" | ||
472 | $ WRITE SYS$OUTPUT "" | ||
473 | $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." | ||
474 | $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." | ||
475 | $ WRITE SYS$OUTPUT "" | ||
476 | $! | ||
477 | $! Time To EXIT. | ||
478 | $! | ||
479 | $ EXIT | ||
480 | $! | ||
481 | $! End The Valid Arguement Check. | ||
482 | $! | ||
483 | $ ENDIF | ||
484 | $! | ||
485 | $! End The P2 Check. | ||
486 | $! | ||
487 | $ ENDIF | ||
488 | $! | ||
489 | $! Check To See If P2 Is Blank. | ||
490 | $! | ||
491 | $ IF (P2.EQS."") | ||
492 | $ THEN | ||
493 | $! | ||
494 | $! O.K., The User Didn't Specify A Compiler, Let's Try To | ||
495 | $! Find Out Which One To Use. | ||
496 | $! | ||
497 | $! Check To See If We Have GNU C. | ||
498 | $! | ||
499 | $ IF (F$TRNLNM("GNU_CC").NES."") | ||
500 | $ THEN | ||
501 | $! | ||
502 | $! Looks Like GNUC, Set To Use GNUC. | ||
503 | $! | ||
504 | $ P2 = "GNUC" | ||
505 | $! | ||
506 | $! End The GNU C Compiler Check. | ||
507 | $! | ||
508 | $ ELSE | ||
509 | $! | ||
510 | $! Check To See If We Have VAXC Or DECC. | ||
511 | $! | ||
512 | $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") | ||
513 | $ THEN | ||
514 | $! | ||
515 | $! Looks Like DECC, Set To Use DECC. | ||
516 | $! | ||
517 | $ P2 = "DECC" | ||
518 | $! | ||
519 | $! Else... | ||
520 | $! | ||
521 | $ ELSE | ||
522 | $! | ||
523 | $! Looks Like VAXC, Set To Use VAXC. | ||
524 | $! | ||
525 | $ P2 = "VAXC" | ||
526 | $! | ||
527 | $! End The VAXC Compiler Check. | ||
528 | $! | ||
529 | $ ENDIF | ||
530 | $! | ||
531 | $! End The DECC & VAXC Compiler Check. | ||
532 | $! | ||
533 | $ ENDIF | ||
534 | $! | ||
535 | $! End The Compiler Check. | ||
536 | $! | ||
537 | $ ENDIF | ||
538 | $! | ||
539 | $! Check To See If We Have A Option For P3. | ||
540 | $! | ||
541 | $ IF (P3.EQS."") | ||
542 | $ THEN | ||
543 | $! | ||
544 | $! Find out what socket library we have available | ||
545 | $! | ||
546 | $ IF F$PARSE("SOCKETSHR:") .NES. "" | ||
547 | $ THEN | ||
548 | $! | ||
549 | $! We have SOCKETSHR, and it is my opinion that it's the best to use. | ||
550 | $! | ||
551 | $ P3 = "SOCKETSHR" | ||
552 | $! | ||
553 | $! Tell the user | ||
554 | $! | ||
555 | $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" | ||
556 | $! | ||
557 | $! Else, let's look for something else | ||
558 | $! | ||
559 | $ ELSE | ||
560 | $! | ||
561 | $! Like UCX (the reason to do this before Multinet is that the UCX | ||
562 | $! emulation is easier to use...) | ||
563 | $! | ||
564 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - | ||
565 | .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - | ||
566 | .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" | ||
567 | $ THEN | ||
568 | $! | ||
569 | $! Last resort: a UCX or UCX-compatible library | ||
570 | $! | ||
571 | $ P3 = "UCX" | ||
572 | $! | ||
573 | $! Tell the user | ||
574 | $! | ||
575 | $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" | ||
576 | $! | ||
577 | $! That was all... | ||
578 | $! | ||
579 | $ ENDIF | ||
580 | $ ENDIF | ||
581 | $ ENDIF | ||
582 | $! | ||
583 | $! Set Up Initial CC Definitions, Possibly With User Ones | ||
584 | $! | ||
585 | $ CCDEFS = "TCPIP_TYPE_''P3'" | ||
586 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS | ||
587 | $ CCEXTRAFLAGS = "" | ||
588 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS | ||
589 | $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX" | ||
590 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - | ||
591 | CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS | ||
592 | $! | ||
593 | $! Check To See If The User Entered A Valid Paramter. | ||
594 | $! | ||
595 | $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") | ||
596 | $ THEN | ||
597 | $! | ||
598 | $! Check To See If The User Wanted DECC. | ||
599 | $! | ||
600 | $ IF (P2.EQS."DECC") | ||
601 | $ THEN | ||
602 | $! | ||
603 | $! Looks Like DECC, Set To Use DECC. | ||
604 | $! | ||
605 | $ COMPILER = "DECC" | ||
606 | $! | ||
607 | $! Tell The User We Are Using DECC. | ||
608 | $! | ||
609 | $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." | ||
610 | $! | ||
611 | $! Use DECC... | ||
612 | $! | ||
613 | $ CC = "CC" | ||
614 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - | ||
615 | THEN CC = "CC/DECC" | ||
616 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - | ||
617 | "/NOLIST/PREFIX=ALL" + - | ||
618 | "/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS | ||
619 | $! | ||
620 | $! Define The Linker Options File Name. | ||
621 | $! | ||
622 | $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" | ||
623 | $! | ||
624 | $! End DECC Check. | ||
625 | $! | ||
626 | $ ENDIF | ||
627 | $! | ||
628 | $! Check To See If We Are To Use VAXC. | ||
629 | $! | ||
630 | $ IF (P2.EQS."VAXC") | ||
631 | $ THEN | ||
632 | $! | ||
633 | $! Looks Like VAXC, Set To Use VAXC. | ||
634 | $! | ||
635 | $ COMPILER = "VAXC" | ||
636 | $! | ||
637 | $! Tell The User We Are Using VAX C. | ||
638 | $! | ||
639 | $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." | ||
640 | $! | ||
641 | $! Compile Using VAXC. | ||
642 | $! | ||
643 | $ CC = "CC" | ||
644 | $ IF ARCH.EQS."AXP" | ||
645 | $ THEN | ||
646 | $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" | ||
647 | $ EXIT | ||
648 | $ ENDIF | ||
649 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" | ||
650 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
651 | "/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS | ||
652 | $ CCDEFS = CCDEFS + ",""VAXC""" | ||
653 | $! | ||
654 | $! Define <sys> As SYS$COMMON:[SYSLIB] | ||
655 | $! | ||
656 | $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] | ||
657 | $! | ||
658 | $! Define The Linker Options File Name. | ||
659 | $! | ||
660 | $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" | ||
661 | $! | ||
662 | $! End VAXC Check | ||
663 | $! | ||
664 | $ ENDIF | ||
665 | $! | ||
666 | $! Check To See If We Are To Use GNU C. | ||
667 | $! | ||
668 | $ IF (P2.EQS."GNUC") | ||
669 | $ THEN | ||
670 | $! | ||
671 | $! Looks Like GNUC, Set To Use GNUC. | ||
672 | $! | ||
673 | $ COMPILER = "GNUC" | ||
674 | $! | ||
675 | $! Tell The User We Are Using GNUC. | ||
676 | $! | ||
677 | $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." | ||
678 | $! | ||
679 | $! Use GNU C... | ||
680 | $! | ||
681 | $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
682 | "/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS | ||
683 | $! | ||
684 | $! Define The Linker Options File Name. | ||
685 | $! | ||
686 | $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" | ||
687 | $! | ||
688 | $! End The GNU C Check. | ||
689 | $! | ||
690 | $ ENDIF | ||
691 | $! | ||
692 | $! Set up default defines | ||
693 | $! | ||
694 | $ CCDEFS = """FLAT_INC=1""," + CCDEFS | ||
695 | $! | ||
696 | $! Finish up the definition of CC. | ||
697 | $! | ||
698 | $ IF COMPILER .EQS. "DECC" | ||
699 | $ THEN | ||
700 | $ IF CCDISABLEWARNINGS .EQS. "" | ||
701 | $ THEN | ||
702 | $ CC4DISABLEWARNINGS = "DOLLARID" | ||
703 | $ ELSE | ||
704 | $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" | ||
705 | $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" | ||
706 | $ ENDIF | ||
707 | $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" | ||
708 | $ ELSE | ||
709 | $ CCDISABLEWARNINGS = "" | ||
710 | $ CC4DISABLEWARNINGS = "" | ||
711 | $ ENDIF | ||
712 | $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS | ||
713 | $! | ||
714 | $! Show user the result | ||
715 | $! | ||
716 | $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC | ||
717 | $! | ||
718 | $! Else The User Entered An Invalid Arguement. | ||
719 | $! | ||
720 | $ ELSE | ||
721 | $! | ||
722 | $! Tell The User We Don't Know What They Want. | ||
723 | $! | ||
724 | $ WRITE SYS$OUTPUT "" | ||
725 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" | ||
726 | $ WRITE SYS$OUTPUT "" | ||
727 | $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." | ||
728 | $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." | ||
729 | $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." | ||
730 | $ WRITE SYS$OUTPUT "" | ||
731 | $! | ||
732 | $! Time To EXIT. | ||
733 | $! | ||
734 | $ EXIT | ||
735 | $ ENDIF | ||
736 | $! | ||
737 | $! Time to check the contents, and to make sure we get the correct library. | ||
738 | $! | ||
739 | $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" - | ||
740 | .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE" | ||
741 | $ THEN | ||
742 | $! | ||
743 | $! Check to see if SOCKETSHR was chosen | ||
744 | $! | ||
745 | $ IF P3.EQS."SOCKETSHR" | ||
746 | $ THEN | ||
747 | $! | ||
748 | $! Set the library to use SOCKETSHR | ||
749 | $! | ||
750 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" | ||
751 | $! | ||
752 | $! Done with SOCKETSHR | ||
753 | $! | ||
754 | $ ENDIF | ||
755 | $! | ||
756 | $! Check to see if MULTINET was chosen | ||
757 | $! | ||
758 | $ IF P3.EQS."MULTINET" | ||
759 | $ THEN | ||
760 | $! | ||
761 | $! Set the library to use UXC emulation. | ||
762 | $! | ||
763 | $ P3 = "UCX" | ||
764 | $! | ||
765 | $! Done with MULTINET | ||
766 | $! | ||
767 | $ ENDIF | ||
768 | $! | ||
769 | $! Check to see if UCX was chosen | ||
770 | $! | ||
771 | $ IF P3.EQS."UCX" | ||
772 | $ THEN | ||
773 | $! | ||
774 | $! Set the library to use UCX. | ||
775 | $! | ||
776 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" | ||
777 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" | ||
778 | $ THEN | ||
779 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" | ||
780 | $ ELSE | ||
781 | $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - | ||
782 | TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" | ||
783 | $ ENDIF | ||
784 | $! | ||
785 | $! Done with UCX | ||
786 | $! | ||
787 | $ ENDIF | ||
788 | $! | ||
789 | $! Check to see if TCPIP was chosen | ||
790 | $! | ||
791 | $ IF P3.EQS."TCPIP" | ||
792 | $ THEN | ||
793 | $! | ||
794 | $! Set the library to use TCPIP (post UCX). | ||
795 | $! | ||
796 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" | ||
797 | $! | ||
798 | $! Done with TCPIP | ||
799 | $! | ||
800 | $ ENDIF | ||
801 | $! | ||
802 | $! Check to see if NONE was chosen | ||
803 | $! | ||
804 | $ IF P3.EQS."NONE" | ||
805 | $ THEN | ||
806 | $! | ||
807 | $! Do not use a TCPIP library. | ||
808 | $! | ||
809 | $ TCPIP_LIB = "" | ||
810 | $! | ||
811 | $! Done with NONE | ||
812 | $! | ||
813 | $ ENDIF | ||
814 | $! | ||
815 | $! Print info | ||
816 | $! | ||
817 | $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB | ||
818 | $! | ||
819 | $! Else The User Entered An Invalid Arguement. | ||
820 | $! | ||
821 | $ ELSE | ||
822 | $! | ||
823 | $! Tell The User We Don't Know What They Want. | ||
824 | $! | ||
825 | $ WRITE SYS$OUTPUT "" | ||
826 | $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" | ||
827 | $ WRITE SYS$OUTPUT "" | ||
828 | $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." | ||
829 | $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." | ||
830 | $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library." | ||
831 | $ WRITE SYS$OUTPUT "" | ||
832 | $! | ||
833 | $! Time To EXIT. | ||
834 | $! | ||
835 | $ EXIT | ||
836 | $! | ||
837 | $! Done with TCP/IP libraries | ||
838 | $! | ||
839 | $ ENDIF | ||
840 | $! | ||
841 | $! Special Threads For OpenVMS v7.1 Or Later | ||
842 | $! | ||
843 | $! Written By: Richard Levitte | ||
844 | $! richard@levitte.org | ||
845 | $! | ||
846 | $! | ||
847 | $! Check To See If We Have A Option For P4. | ||
848 | $! | ||
849 | $ IF (P4.EQS."") | ||
850 | $ THEN | ||
851 | $! | ||
852 | $! Get The Version Of VMS We Are Using. | ||
853 | $! | ||
854 | $ ISSEVEN := | ||
855 | $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) | ||
856 | $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) | ||
857 | $! | ||
858 | $! Check To See If The VMS Version Is v7.1 Or Later. | ||
859 | $! | ||
860 | $ IF (TMP.GE.71) | ||
861 | $ THEN | ||
862 | $! | ||
863 | $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. | ||
864 | $! | ||
865 | $ ISSEVEN := ,PTHREAD_USE_D4 | ||
866 | $! | ||
867 | $! End The VMS Version Check. | ||
868 | $! | ||
869 | $ ENDIF | ||
870 | $! | ||
871 | $! End The P4 Check. | ||
872 | $! | ||
873 | $ ENDIF | ||
874 | $! | ||
875 | $! Time To RETURN... | ||
876 | $! | ||
877 | $ RETURN | ||
878 | $! | ||
879 | $ INITIALISE: | ||
880 | $! | ||
881 | $! Save old value of the logical name OPENSSL | ||
882 | $! | ||
883 | $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") | ||
884 | $! | ||
885 | $! Save directory information | ||
886 | $! | ||
887 | $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" | ||
888 | $ __HERE = F$EDIT(__HERE,"UPCASE") | ||
889 | $ __TOP = __HERE - "TEST]" | ||
890 | $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" | ||
891 | $! | ||
892 | $! Set up the logical name OPENSSL to point at the include directory | ||
893 | $! | ||
894 | $ DEFINE OPENSSL/NOLOG '__INCLUDE' | ||
895 | $! | ||
896 | $! Done | ||
897 | $! | ||
898 | $ RETURN | ||
899 | $! | ||
900 | $ CLEANUP: | ||
901 | $! | ||
902 | $! Restore the logical name OPENSSL if it had a value | ||
903 | $! | ||
904 | $ IF __SAVE_OPENSSL .EQS. "" | ||
905 | $ THEN | ||
906 | $ DEASSIGN OPENSSL | ||
907 | $ ELSE | ||
908 | $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' | ||
909 | $ ENDIF | ||
910 | $! | ||
911 | $! Done | ||
912 | $! | ||
913 | $ RETURN | ||
diff --git a/src/lib/libssl/test/md4test.c b/src/lib/libssl/test/md4test.c new file mode 100644 index 0000000000..e0fdc42282 --- /dev/null +++ b/src/lib/libssl/test/md4test.c | |||
@@ -0,0 +1,134 @@ | |||
1 | /* crypto/md4/md4test.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <string.h> | ||
61 | #include <stdlib.h> | ||
62 | |||
63 | #ifdef OPENSSL_NO_MD4 | ||
64 | int main(int argc, char *argv[]) | ||
65 | { | ||
66 | printf("No MD4 support\n"); | ||
67 | return(0); | ||
68 | } | ||
69 | #else | ||
70 | #include <openssl/evp.h> | ||
71 | #include <openssl/md4.h> | ||
72 | |||
73 | static char *test[]={ | ||
74 | "", | ||
75 | "a", | ||
76 | "abc", | ||
77 | "message digest", | ||
78 | "abcdefghijklmnopqrstuvwxyz", | ||
79 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | ||
80 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | ||
81 | NULL, | ||
82 | }; | ||
83 | |||
84 | static char *ret[]={ | ||
85 | "31d6cfe0d16ae931b73c59d7e0c089c0", | ||
86 | "bde52cb31de33e46245e05fbdbd6fb24", | ||
87 | "a448017aaf21d8525fc10ae87aa6729d", | ||
88 | "d9130a8164549fe818874806e1c7014b", | ||
89 | "d79e1c308aa5bbcdeea8ed63df412da9", | ||
90 | "043f8582f241db351ce627e153e7f0e4", | ||
91 | "e33b4ddc9c38f2199c3e7b164fcc0536", | ||
92 | }; | ||
93 | |||
94 | static char *pt(unsigned char *md); | ||
95 | int main(int argc, char *argv[]) | ||
96 | { | ||
97 | int i,err=0; | ||
98 | unsigned char **P,**R; | ||
99 | char *p; | ||
100 | unsigned char md[MD4_DIGEST_LENGTH]; | ||
101 | |||
102 | P=(unsigned char **)test; | ||
103 | R=(unsigned char **)ret; | ||
104 | i=1; | ||
105 | while (*P != NULL) | ||
106 | { | ||
107 | EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_md4(), NULL); | ||
108 | p=pt(md); | ||
109 | if (strcmp(p,(char *)*R) != 0) | ||
110 | { | ||
111 | printf("error calculating MD4 on '%s'\n",*P); | ||
112 | printf("got %s instead of %s\n",p,*R); | ||
113 | err++; | ||
114 | } | ||
115 | else | ||
116 | printf("test %d ok\n",i); | ||
117 | i++; | ||
118 | R++; | ||
119 | P++; | ||
120 | } | ||
121 | exit(err); | ||
122 | return(0); | ||
123 | } | ||
124 | |||
125 | static char *pt(unsigned char *md) | ||
126 | { | ||
127 | int i; | ||
128 | static char buf[80]; | ||
129 | |||
130 | for (i=0; i<MD4_DIGEST_LENGTH; i++) | ||
131 | sprintf(&(buf[i*2]),"%02x",md[i]); | ||
132 | return(buf); | ||
133 | } | ||
134 | #endif | ||
diff --git a/src/lib/libssl/test/rsa_test.c b/src/lib/libssl/test/rsa_test.c new file mode 100644 index 0000000000..b8b462d33b --- /dev/null +++ b/src/lib/libssl/test/rsa_test.c | |||
@@ -0,0 +1,318 @@ | |||
1 | /* test vectors from p1ovect1.txt */ | ||
2 | |||
3 | #include <stdio.h> | ||
4 | #include <string.h> | ||
5 | |||
6 | #include "e_os.h" | ||
7 | |||
8 | #include <openssl/crypto.h> | ||
9 | #include <openssl/err.h> | ||
10 | #include <openssl/rand.h> | ||
11 | #ifdef OPENSSL_NO_RSA | ||
12 | int main(int argc, char *argv[]) | ||
13 | { | ||
14 | printf("No RSA support\n"); | ||
15 | return(0); | ||
16 | } | ||
17 | #else | ||
18 | #include <openssl/rsa.h> | ||
19 | #include <openssl/engine.h> | ||
20 | |||
21 | #define SetKey \ | ||
22 | key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \ | ||
23 | key->e = BN_bin2bn(e, sizeof(e)-1, key->e); \ | ||
24 | key->d = BN_bin2bn(d, sizeof(d)-1, key->d); \ | ||
25 | key->p = BN_bin2bn(p, sizeof(p)-1, key->p); \ | ||
26 | key->q = BN_bin2bn(q, sizeof(q)-1, key->q); \ | ||
27 | key->dmp1 = BN_bin2bn(dmp1, sizeof(dmp1)-1, key->dmp1); \ | ||
28 | key->dmq1 = BN_bin2bn(dmq1, sizeof(dmq1)-1, key->dmq1); \ | ||
29 | key->iqmp = BN_bin2bn(iqmp, sizeof(iqmp)-1, key->iqmp); \ | ||
30 | memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \ | ||
31 | return (sizeof(ctext_ex) - 1); | ||
32 | |||
33 | static int key1(RSA *key, unsigned char *c) | ||
34 | { | ||
35 | static unsigned char n[] = | ||
36 | "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F" | ||
37 | "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5" | ||
38 | "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93" | ||
39 | "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1" | ||
40 | "\xF5"; | ||
41 | |||
42 | static unsigned char e[] = "\x11"; | ||
43 | |||
44 | static unsigned char d[] = | ||
45 | "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44" | ||
46 | "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64" | ||
47 | "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9" | ||
48 | "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"; | ||
49 | |||
50 | static unsigned char p[] = | ||
51 | "\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" | ||
52 | "\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12" | ||
53 | "\x0D"; | ||
54 | |||
55 | static unsigned char q[] = | ||
56 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
57 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" | ||
58 | "\x89"; | ||
59 | |||
60 | static unsigned char dmp1[] = | ||
61 | "\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF" | ||
62 | "\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05"; | ||
63 | |||
64 | static unsigned char dmq1[] = | ||
65 | "\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99" | ||
66 | "\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D" | ||
67 | "\x51"; | ||
68 | |||
69 | static unsigned char iqmp[] = | ||
70 | "\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8" | ||
71 | "\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26"; | ||
72 | |||
73 | static unsigned char ctext_ex[] = | ||
74 | "\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89" | ||
75 | "\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52" | ||
76 | "\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44" | ||
77 | "\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2"; | ||
78 | |||
79 | SetKey; | ||
80 | } | ||
81 | |||
82 | static int key2(RSA *key, unsigned char *c) | ||
83 | { | ||
84 | static unsigned char n[] = | ||
85 | "\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8" | ||
86 | "\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26" | ||
87 | "\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8" | ||
88 | "\x34\x77\xCF"; | ||
89 | |||
90 | static unsigned char e[] = "\x3"; | ||
91 | |||
92 | static unsigned char d[] = | ||
93 | "\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2" | ||
94 | "\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41" | ||
95 | "\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21" | ||
96 | "\xE5\xEB"; | ||
97 | |||
98 | static unsigned char p[] = | ||
99 | "\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92" | ||
100 | "\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91"; | ||
101 | |||
102 | static unsigned char q[] = | ||
103 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
104 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5F"; | ||
105 | |||
106 | static unsigned char dmp1[] = | ||
107 | "\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61" | ||
108 | "\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B"; | ||
109 | |||
110 | static unsigned char dmq1[] = | ||
111 | "\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90" | ||
112 | "\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F"; | ||
113 | |||
114 | static unsigned char iqmp[] = | ||
115 | "\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13" | ||
116 | "\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D"; | ||
117 | |||
118 | static unsigned char ctext_ex[] = | ||
119 | "\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a" | ||
120 | "\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4" | ||
121 | "\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52" | ||
122 | "\x62\x51"; | ||
123 | |||
124 | SetKey; | ||
125 | } | ||
126 | |||
127 | static int key3(RSA *key, unsigned char *c) | ||
128 | { | ||
129 | static unsigned char n[] = | ||
130 | "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71" | ||
131 | "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5" | ||
132 | "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD" | ||
133 | "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80" | ||
134 | "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25" | ||
135 | "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39" | ||
136 | "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68" | ||
137 | "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD" | ||
138 | "\xCB"; | ||
139 | |||
140 | static unsigned char e[] = "\x11"; | ||
141 | |||
142 | static unsigned char d[] = | ||
143 | "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD" | ||
144 | "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41" | ||
145 | "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69" | ||
146 | "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA" | ||
147 | "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94" | ||
148 | "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A" | ||
149 | "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94" | ||
150 | "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3" | ||
151 | "\xC1"; | ||
152 | |||
153 | static unsigned char p[] = | ||
154 | "\x00\xEE\xCF\xAE\x81\xB1\xB9\xB3\xC9\x08\x81\x0B\x10\xA1\xB5\x60" | ||
155 | "\x01\x99\xEB\x9F\x44\xAE\xF4\xFD\xA4\x93\xB8\x1A\x9E\x3D\x84\xF6" | ||
156 | "\x32\x12\x4E\xF0\x23\x6E\x5D\x1E\x3B\x7E\x28\xFA\xE7\xAA\x04\x0A" | ||
157 | "\x2D\x5B\x25\x21\x76\x45\x9D\x1F\x39\x75\x41\xBA\x2A\x58\xFB\x65" | ||
158 | "\x99"; | ||
159 | |||
160 | static unsigned char q[] = | ||
161 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
162 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" | ||
163 | "\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" | ||
164 | "\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x15" | ||
165 | "\x03"; | ||
166 | |||
167 | static unsigned char dmp1[] = | ||
168 | "\x54\x49\x4C\xA6\x3E\xBA\x03\x37\xE4\xE2\x40\x23\xFC\xD6\x9A\x5A" | ||
169 | "\xEB\x07\xDD\xDC\x01\x83\xA4\xD0\xAC\x9B\x54\xB0\x51\xF2\xB1\x3E" | ||
170 | "\xD9\x49\x09\x75\xEA\xB7\x74\x14\xFF\x59\xC1\xF7\x69\x2E\x9A\x2E" | ||
171 | "\x20\x2B\x38\xFC\x91\x0A\x47\x41\x74\xAD\xC9\x3C\x1F\x67\xC9\x81"; | ||
172 | |||
173 | static unsigned char dmq1[] = | ||
174 | "\x47\x1E\x02\x90\xFF\x0A\xF0\x75\x03\x51\xB7\xF8\x78\x86\x4C\xA9" | ||
175 | "\x61\xAD\xBD\x3A\x8A\x7E\x99\x1C\x5C\x05\x56\xA9\x4C\x31\x46\xA7" | ||
176 | "\xF9\x80\x3F\x8F\x6F\x8A\xE3\x42\xE9\x31\xFD\x8A\xE4\x7A\x22\x0D" | ||
177 | "\x1B\x99\xA4\x95\x84\x98\x07\xFE\x39\xF9\x24\x5A\x98\x36\xDA\x3D"; | ||
178 | |||
179 | static unsigned char iqmp[] = | ||
180 | "\x00\xB0\x6C\x4F\xDA\xBB\x63\x01\x19\x8D\x26\x5B\xDB\xAE\x94\x23" | ||
181 | "\xB3\x80\xF2\x71\xF7\x34\x53\x88\x50\x93\x07\x7F\xCD\x39\xE2\x11" | ||
182 | "\x9F\xC9\x86\x32\x15\x4F\x58\x83\xB1\x67\xA9\x67\xBF\x40\x2B\x4E" | ||
183 | "\x9E\x2E\x0F\x96\x56\xE6\x98\xEA\x36\x66\xED\xFB\x25\x79\x80\x39" | ||
184 | "\xF7"; | ||
185 | |||
186 | static unsigned char ctext_ex[] = | ||
187 | "\xb8\x24\x6b\x56\xa6\xed\x58\x81\xae\xb5\x85\xd9\xa2\x5b\x2a\xd7" | ||
188 | "\x90\xc4\x17\xe0\x80\x68\x1b\xf1\xac\x2b\xc3\xde\xb6\x9d\x8b\xce" | ||
189 | "\xf0\xc4\x36\x6f\xec\x40\x0a\xf0\x52\xa7\x2e\x9b\x0e\xff\xb5\xb3" | ||
190 | "\xf2\xf1\x92\xdb\xea\xca\x03\xc1\x27\x40\x05\x71\x13\xbf\x1f\x06" | ||
191 | "\x69\xac\x22\xe9\xf3\xa7\x85\x2e\x3c\x15\xd9\x13\xca\xb0\xb8\x86" | ||
192 | "\x3a\x95\xc9\x92\x94\xce\x86\x74\x21\x49\x54\x61\x03\x46\xf4\xd4" | ||
193 | "\x74\xb2\x6f\x7c\x48\xb4\x2e\xe6\x8e\x1f\x57\x2a\x1f\xc4\x02\x6a" | ||
194 | "\xc4\x56\xb4\xf5\x9f\x7b\x62\x1e\xa1\xb9\xd8\x8f\x64\x20\x2f\xb1"; | ||
195 | |||
196 | SetKey; | ||
197 | } | ||
198 | |||
199 | static int pad_unknown(void) | ||
200 | { | ||
201 | unsigned long l; | ||
202 | while ((l = ERR_get_error()) != 0) | ||
203 | if (ERR_GET_REASON(l) == RSA_R_UNKNOWN_PADDING_TYPE) | ||
204 | return(1); | ||
205 | return(0); | ||
206 | } | ||
207 | |||
208 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | ||
209 | |||
210 | int main(int argc, char *argv[]) | ||
211 | { | ||
212 | int err=0; | ||
213 | int v; | ||
214 | RSA *key; | ||
215 | unsigned char ptext[256]; | ||
216 | unsigned char ctext[256]; | ||
217 | static unsigned char ptext_ex[] = "\x54\x85\x9b\x34\x2c\x49\xea\x2a"; | ||
218 | unsigned char ctext_ex[256]; | ||
219 | int plen; | ||
220 | int clen = 0; | ||
221 | int num; | ||
222 | |||
223 | CRYPTO_malloc_debug_init(); | ||
224 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); | ||
225 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
226 | |||
227 | RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */ | ||
228 | |||
229 | plen = sizeof(ptext_ex) - 1; | ||
230 | |||
231 | for (v = 0; v < 3; v++) | ||
232 | { | ||
233 | key = RSA_new(); | ||
234 | switch (v) { | ||
235 | case 0: | ||
236 | clen = key1(key, ctext_ex); | ||
237 | break; | ||
238 | case 1: | ||
239 | clen = key2(key, ctext_ex); | ||
240 | break; | ||
241 | case 2: | ||
242 | clen = key3(key, ctext_ex); | ||
243 | break; | ||
244 | } | ||
245 | |||
246 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, | ||
247 | RSA_PKCS1_PADDING); | ||
248 | if (num != clen) | ||
249 | { | ||
250 | printf("PKCS#1 v1.5 encryption failed!\n"); | ||
251 | err=1; | ||
252 | goto oaep; | ||
253 | } | ||
254 | |||
255 | num = RSA_private_decrypt(num, ctext, ptext, key, | ||
256 | RSA_PKCS1_PADDING); | ||
257 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
258 | { | ||
259 | printf("PKCS#1 v1.5 decryption failed!\n"); | ||
260 | err=1; | ||
261 | } | ||
262 | else | ||
263 | printf("PKCS #1 v1.5 encryption/decryption ok\n"); | ||
264 | |||
265 | oaep: | ||
266 | ERR_clear_error(); | ||
267 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, | ||
268 | RSA_PKCS1_OAEP_PADDING); | ||
269 | if (num == -1 && pad_unknown()) | ||
270 | { | ||
271 | printf("No OAEP support\n"); | ||
272 | goto next; | ||
273 | } | ||
274 | if (num != clen) | ||
275 | { | ||
276 | printf("OAEP encryption failed!\n"); | ||
277 | err=1; | ||
278 | goto next; | ||
279 | } | ||
280 | |||
281 | num = RSA_private_decrypt(num, ctext, ptext, key, | ||
282 | RSA_PKCS1_OAEP_PADDING); | ||
283 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
284 | { | ||
285 | printf("OAEP decryption (encrypted data) failed!\n"); | ||
286 | err=1; | ||
287 | } | ||
288 | else if (memcmp(ctext, ctext_ex, num) == 0) | ||
289 | { | ||
290 | printf("OAEP test vector %d passed!\n", v); | ||
291 | goto next; | ||
292 | } | ||
293 | |||
294 | /* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT). | ||
295 | Try decrypting ctext_ex */ | ||
296 | |||
297 | num = RSA_private_decrypt(clen, ctext_ex, ptext, key, | ||
298 | RSA_PKCS1_OAEP_PADDING); | ||
299 | |||
300 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
301 | { | ||
302 | printf("OAEP decryption (test vector data) failed!\n"); | ||
303 | err=1; | ||
304 | } | ||
305 | else | ||
306 | printf("OAEP encryption/decryption ok\n"); | ||
307 | next: | ||
308 | RSA_free(key); | ||
309 | } | ||
310 | |||
311 | CRYPTO_cleanup_all_ex_data(); | ||
312 | ERR_remove_state(0); | ||
313 | |||
314 | CRYPTO_mem_leaks_fp(stderr); | ||
315 | |||
316 | return err; | ||
317 | } | ||
318 | #endif | ||
diff --git a/src/lib/libssl/test/tcrl.com b/src/lib/libssl/test/tcrl.com new file mode 100644 index 0000000000..86bf9735aa --- /dev/null +++ b/src/lib/libssl/test/tcrl.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TCRL.COM -- Tests crl keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl crl | ||
8 | $ | ||
9 | $ t := testcrl.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing CRL conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/testca.com b/src/lib/libssl/test/testca.com new file mode 100644 index 0000000000..c670f2bf5f --- /dev/null +++ b/src/lib/libssl/test/testca.com | |||
@@ -0,0 +1,78 @@ | |||
1 | $! TESTCA.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ openssl := mcr 'exe_dir'openssl | ||
8 | $ | ||
9 | $ SSLEAY_CONFIG="-config ""CAss.cnf""" | ||
10 | $ | ||
11 | $ set noon | ||
12 | $ if f$search("demoCA.dir") .nes. "" | ||
13 | $ then | ||
14 | $ call deltree [.demoCA]*.* | ||
15 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
16 | $ delete demoCA.dir;* | ||
17 | $ endif | ||
18 | $ set on | ||
19 | $ open/read sys$ca_input VMSca-response.1 | ||
20 | $ @[-.apps]CA.com -input sys$ca_input -newca | ||
21 | $ close sys$ca_input | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ | ||
24 | $ | ||
25 | $ SSLEAY_CONFIG="-config ""Uss.cnf""" | ||
26 | $ @[-.apps]CA.com -newreq | ||
27 | $ if $severity .ne. 1 then exit 3 | ||
28 | $ | ||
29 | $ | ||
30 | $ SSLEAY_CONFIG="-config [-.apps]openssl-vms.cnf" | ||
31 | $ open/read sys$ca_input VMSca-response.2 | ||
32 | $ @[-.apps]CA.com -input sys$ca_input -sign | ||
33 | $ close sys$ca_input | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $ | ||
36 | $ | ||
37 | $ @[-.apps]CA.com -verify newcert.pem | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $ set noon | ||
41 | $ call deltree [.demoCA]*.* | ||
42 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
43 | $ delete demoCA.dir;* | ||
44 | $ if f$search("newcert.pem") .nes. "" then delete newcert.pem;* | ||
45 | $ if f$search("newcert.pem") .nes. "" then delete newreq.pem;* | ||
46 | $ set on | ||
47 | $! #usage: CA -newcert|-newreq|-newca|-sign|-verify | ||
48 | $ | ||
49 | $ exit | ||
50 | $ | ||
51 | $ deltree: subroutine ! P1 is a name of a directory | ||
52 | $ on control_y then goto dt_STOP | ||
53 | $ on warning then goto dt_exit | ||
54 | $ _dt_def = f$trnlnm("SYS$DISK")+f$directory() | ||
55 | $ if f$parse(p1) .eqs. "" then exit | ||
56 | $ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")' | ||
57 | $ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE") | ||
58 | $ _fp = f$parse(".DIR",p1) | ||
59 | $ dt_loop: | ||
60 | $ _f = f$search(_fp) | ||
61 | $ if _f .eqs. "" then goto dt_loopend | ||
62 | $ call deltree [.'f$parse(_f,,,"NAME")']*.* | ||
63 | $ goto dt_loop | ||
64 | $ dt_loopend: | ||
65 | $ _fp = f$parse(p1,".;*") | ||
66 | $ if f$search(_fp) .eqs. "" then goto dt_exit | ||
67 | $ set noon | ||
68 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp' | ||
69 | $ set on | ||
70 | $ delete/nolog '_fp' | ||
71 | $ dt_exit: | ||
72 | $ set default '_dt_def' | ||
73 | $ exit | ||
74 | $ dt_STOP: | ||
75 | $ set default '_dt_def' | ||
76 | $ stop/id="" | ||
77 | $ exit | ||
78 | $ endsubroutine | ||
diff --git a/src/lib/libssl/test/testenc.com b/src/lib/libssl/test/testenc.com new file mode 100644 index 0000000000..c24fa388c0 --- /dev/null +++ b/src/lib/libssl/test/testenc.com | |||
@@ -0,0 +1,62 @@ | |||
1 | $! TESTENC.COM -- Test encoding and decoding | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ testsrc := makefile.ssl | ||
8 | $ test := p.txt | ||
9 | $ cmd := mcr 'exe_dir'openssl | ||
10 | $ | ||
11 | $ if f$search(test) .nes. "" then delete 'test';* | ||
12 | $ convert/fdl=sys$input: 'testsrc' 'test' | ||
13 | RECORD | ||
14 | FORMAT STREAM_LF | ||
15 | $ | ||
16 | $ if f$search(test+"-cipher") .nes. "" then delete 'test'-cipher;* | ||
17 | $ if f$search(test+"-clear") .nes. "" then delete 'test'-clear;* | ||
18 | $ | ||
19 | $ write sys$output "cat" | ||
20 | $ 'cmd' enc -in 'test' -out 'test'-cipher | ||
21 | $ 'cmd' enc -in 'test'-cipher -out 'test'-clear | ||
22 | $ backup/compare 'test' 'test'-clear | ||
23 | $ if $severity .ne. 1 then exit 3 | ||
24 | $ delete 'test'-cipher;*,'test'-clear;* | ||
25 | $ | ||
26 | $ write sys$output "base64" | ||
27 | $ 'cmd' enc -a -e -in 'test' -out 'test'-cipher | ||
28 | $ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear | ||
29 | $ backup/compare 'test' 'test'-clear | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ delete 'test'-cipher;*,'test'-clear;* | ||
32 | $ | ||
33 | $ define/user sys$output 'test'-cipher-commands | ||
34 | $ 'cmd' list-cipher-commands | ||
35 | $ open/read f 'test'-cipher-commands | ||
36 | $ loop_cipher_commands: | ||
37 | $ read/end=loop_cipher_commands_end f i | ||
38 | $ write sys$output i | ||
39 | $ | ||
40 | $ if f$search(test+"-"+i+"-cipher") .nes. "" then - | ||
41 | delete 'test'-'i'-cipher;* | ||
42 | $ if f$search(test+"-"+i+"-clear") .nes. "" then - | ||
43 | delete 'test'-'i'-clear;* | ||
44 | $ | ||
45 | $ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher | ||
46 | $ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
47 | $ backup/compare 'test' 'test'-'i'-clear | ||
48 | $ if $severity .ne. 1 then exit 3 | ||
49 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
50 | $ | ||
51 | $ write sys$output i," base64" | ||
52 | $ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher | ||
53 | $ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
54 | $ backup/compare 'test' 'test'-'i'-clear | ||
55 | $ if $severity .ne. 1 then exit 3 | ||
56 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
57 | $ | ||
58 | $ goto loop_cipher_commands | ||
59 | $ loop_cipher_commands_end: | ||
60 | $ close f | ||
61 | $ delete 'test'-cipher-commands;* | ||
62 | $ delete 'test';* | ||
diff --git a/src/lib/libssl/test/testgen.com b/src/lib/libssl/test/testgen.com new file mode 100644 index 0000000000..5d28ebec72 --- /dev/null +++ b/src/lib/libssl/test/testgen.com | |||
@@ -0,0 +1,52 @@ | |||
1 | $! TETSGEN.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ T := testcert | ||
8 | $ KEY = 512 | ||
9 | $ CA := [-.certs]testca.pem | ||
10 | $ | ||
11 | $ set noon | ||
12 | $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;* | ||
13 | $ if f$search(T+".2;*") .nes. "" then delete 'T'.2;* | ||
14 | $ if f$search(T+".key;*") .nes. "" then delete 'T'.key;* | ||
15 | $ set on | ||
16 | $ | ||
17 | $ write sys$output "generating certificate request" | ||
18 | $ | ||
19 | $ append/new nl: .rnd | ||
20 | $ open/append random_file .rnd | ||
21 | $ write random_file "string to make the random number generator think it has entropy" | ||
22 | $ close random_file | ||
23 | $ | ||
24 | $ set noon | ||
25 | $ define/user sys$output nla0: | ||
26 | $ mcr 'exe_dir'openssl no-rsa | ||
27 | $ save_severity=$SEVERITY | ||
28 | $ set on | ||
29 | $ if save_severity | ||
30 | $ then | ||
31 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
32 | $ else | ||
33 | $ req_new="-new" | ||
34 | $ write sys$output "There should be a 2 sequences of .'s and some +'s." | ||
35 | $ write sys$output "There should not be more that at most 80 per line" | ||
36 | $ endif | ||
37 | $ | ||
38 | $ write sys$output "This could take some time." | ||
39 | $ | ||
40 | $ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem | ||
41 | $ if $severity .ne. 1 | ||
42 | $ then | ||
43 | $ write sys$output "problems creating request" | ||
44 | $ exit 3 | ||
45 | $ endif | ||
46 | $ | ||
47 | $ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout | ||
48 | $ if $severity .ne. 1 | ||
49 | $ then | ||
50 | $ write sys$output "signature on req is wrong" | ||
51 | $ exit 3 | ||
52 | $ endif | ||
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com new file mode 100644 index 0000000000..07a3c7f16d --- /dev/null +++ b/src/lib/libssl/test/tests.com | |||
@@ -0,0 +1,246 @@ | |||
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,test_evp | ||
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 | $ EVPTEST := evp_test | ||
57 | $ | ||
58 | $ tests_i = 0 | ||
59 | $ loop_tests: | ||
60 | $ tests_e = f$element(tests_i,",",tests) | ||
61 | $ tests_i = tests_i + 1 | ||
62 | $ if tests_e .eqs. "," then goto exit | ||
63 | $ gosub 'tests_e' | ||
64 | $ goto loop_tests | ||
65 | $ | ||
66 | $ test_evp: | ||
67 | $ mcr 'texe_dir''evptest' evptests.txt | ||
68 | $ return | ||
69 | $ test_des: | ||
70 | $ mcr 'texe_dir''destest' | ||
71 | $ return | ||
72 | $ test_idea: | ||
73 | $ mcr 'texe_dir''ideatest' | ||
74 | $ return | ||
75 | $ test_sha: | ||
76 | $ mcr 'texe_dir''shatest' | ||
77 | $ mcr 'texe_dir''sha1test' | ||
78 | $ return | ||
79 | $ test_mdc2: | ||
80 | $ mcr 'texe_dir''mdc2test' | ||
81 | $ return | ||
82 | $ test_md5: | ||
83 | $ mcr 'texe_dir''md5test' | ||
84 | $ return | ||
85 | $ test_md4: | ||
86 | $ mcr 'texe_dir''md4test' | ||
87 | $ return | ||
88 | $ test_hmac: | ||
89 | $ mcr 'texe_dir''hmactest' | ||
90 | $ return | ||
91 | $ test_md2: | ||
92 | $ mcr 'texe_dir''md2test' | ||
93 | $ return | ||
94 | $ test_rmd: | ||
95 | $ mcr 'texe_dir''rmdtest' | ||
96 | $ return | ||
97 | $ test_bf: | ||
98 | $ mcr 'texe_dir''bftest' | ||
99 | $ return | ||
100 | $ test_cast: | ||
101 | $ mcr 'texe_dir''casttest' | ||
102 | $ return | ||
103 | $ test_rc2: | ||
104 | $ mcr 'texe_dir''rc2test' | ||
105 | $ return | ||
106 | $ test_rc4: | ||
107 | $ mcr 'texe_dir''rc4test' | ||
108 | $ return | ||
109 | $ test_rc5: | ||
110 | $ mcr 'texe_dir''rc5test' | ||
111 | $ return | ||
112 | $ test_rand: | ||
113 | $ mcr 'texe_dir''randtest' | ||
114 | $ return | ||
115 | $ test_enc: | ||
116 | $ @testenc.com | ||
117 | $ return | ||
118 | $ test_x509: | ||
119 | $ define sys$error nla0: | ||
120 | $ write sys$output "test normal x509v1 certificate" | ||
121 | $ @tx509.com | ||
122 | $ write sys$output "test first x509v3 certificate" | ||
123 | $ @tx509.com v3-cert1.pem | ||
124 | $ write sys$output "test second x509v3 certificate" | ||
125 | $ @tx509.com v3-cert2.pem | ||
126 | $ deassign sys$error | ||
127 | $ return | ||
128 | $ test_rsa: | ||
129 | $ define sys$error nla0: | ||
130 | $ @trsa.com | ||
131 | $ deassign sys$error | ||
132 | $ mcr 'texe_dir''rsatest' | ||
133 | $ return | ||
134 | $ test_crl: | ||
135 | $ define sys$error nla0: | ||
136 | $ @tcrl.com | ||
137 | $ deassign sys$error | ||
138 | $ return | ||
139 | $ test_sid: | ||
140 | $ define sys$error nla0: | ||
141 | $ @tsid.com | ||
142 | $ deassign sys$error | ||
143 | $ return | ||
144 | $ test_req: | ||
145 | $ define sys$error nla0: | ||
146 | $ @treq.com | ||
147 | $ @treq.com testreq2.pem | ||
148 | $ deassign sys$error | ||
149 | $ return | ||
150 | $ test_pkcs7: | ||
151 | $ define sys$error nla0: | ||
152 | $ @tpkcs7.com | ||
153 | $ @tpkcs7d.com | ||
154 | $ deassign sys$error | ||
155 | $ return | ||
156 | $ test_bn: | ||
157 | $ write sys$output "starting big number library test, could take a while..." | ||
158 | $ create bntest-vms.fdl | ||
159 | FILE | ||
160 | ORGANIZATION sequential | ||
161 | RECORD | ||
162 | FORMAT stream_lf | ||
163 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | ||
164 | $ open/append foo bntest-vms.sh | ||
165 | $ type/output=foo: sys$input: | ||
166 | << __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"' | ||
167 | $ define/user sys$output bntest-vms.tmp | ||
168 | $ mcr 'texe_dir''bntest' | ||
169 | $ copy bntest-vms.tmp foo: | ||
170 | $ delete bntest-vms.tmp;* | ||
171 | $ type/output=foo: sys$input: | ||
172 | __FOO__ | ||
173 | $ close foo | ||
174 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" | ||
175 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" | ||
176 | $ write sys$output "-- went well." | ||
177 | $ write sys$output "" | ||
178 | $ write sys$output "test a^b%c implementations" | ||
179 | $ mcr 'texe_dir''exptest' | ||
180 | $ return | ||
181 | $ test_ec: | ||
182 | $ write sys$output "test elliptic curves" | ||
183 | $ mcr 'texe_dir''ectest' | ||
184 | $ return | ||
185 | $ test_verify: | ||
186 | $ write sys$output "The following command should have some OK's and some failures" | ||
187 | $ write sys$output "There are definitly a few expired certificates" | ||
188 | $ @tverify.com | ||
189 | $ return | ||
190 | $ test_dh: | ||
191 | $ write sys$output "Generate a set of DH parameters" | ||
192 | $ mcr 'texe_dir''dhtest' | ||
193 | $ return | ||
194 | $ test_dsa: | ||
195 | $ write sys$output "Generate a set of DSA parameters" | ||
196 | $ mcr 'texe_dir''dsatest' | ||
197 | $ return | ||
198 | $ test_gen: | ||
199 | $ write sys$output "Generate and verify a certificate request" | ||
200 | $ @testgen.com | ||
201 | $ return | ||
202 | $ maybe_test_ss: | ||
203 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) | ||
204 | $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then - | ||
205 | goto test_ss | ||
206 | $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then - | ||
207 | goto test_ss | ||
208 | $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | ||
209 | goto test_ss | ||
210 | $ return | ||
211 | $ test_ss: | ||
212 | $ write sys$output "Generate and certify a test certificate" | ||
213 | $ @testss.com | ||
214 | $ return | ||
215 | $ test_engine: | ||
216 | $ write sys$output "Manipulate the ENGINE structures" | ||
217 | $ mcr 'texe_dir''enginetest' | ||
218 | $ return | ||
219 | $ test_ssl: | ||
220 | $ write sys$output "test SSL protocol" | ||
221 | $ gosub maybe_test_ss | ||
222 | $ @testssl.com keyU.ss certU.ss certCA.ss | ||
223 | $ return | ||
224 | $ test_ca: | ||
225 | $ set noon | ||
226 | $ define/user sys$output nla0: | ||
227 | $ mcr 'exe_dir'openssl no-rsa | ||
228 | $ save_severity=$SEVERITY | ||
229 | $ set on | ||
230 | $ if save_severity | ||
231 | $ then | ||
232 | $ write sys$output "skipping CA.com test -- requires RSA" | ||
233 | $ else | ||
234 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | ||
235 | $ @testca.com | ||
236 | $ endif | ||
237 | $ return | ||
238 | $ test_rd: | ||
239 | $ write sys$output "test Rijndael" | ||
240 | $ !mcr 'texe_dir''rdtest' | ||
241 | $ return | ||
242 | $ | ||
243 | $ | ||
244 | $ exit: | ||
245 | $ set default '__save_default' | ||
246 | $ exit | ||
diff --git a/src/lib/libssl/test/testss.com b/src/lib/libssl/test/testss.com new file mode 100644 index 0000000000..685ae5043d --- /dev/null +++ b/src/lib/libssl/test/testss.com | |||
@@ -0,0 +1,118 @@ | |||
1 | $! TESTSS.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ digest="-md5" | ||
8 | $ reqcmd := mcr 'exe_dir'openssl req | ||
9 | $ x509cmd := mcr 'exe_dir'openssl x509 'digest' | ||
10 | $ verifycmd := mcr 'exe_dir'openssl verify | ||
11 | $ dummycnf := sys$disk:[-.apps]openssl-vms.cnf | ||
12 | $ | ||
13 | $ CAkey="""keyCA.ss""" | ||
14 | $ CAcert="""certCA.ss""" | ||
15 | $ CAreq="""reqCA.ss""" | ||
16 | $ CAconf="""CAss.cnf""" | ||
17 | $ CAreq2="""req2CA.ss""" ! temp | ||
18 | $ | ||
19 | $ Uconf="""Uss.cnf""" | ||
20 | $ Ukey="""keyU.ss""" | ||
21 | $ Ureq="""reqU.ss""" | ||
22 | $ Ucert="""certU.ss""" | ||
23 | $ | ||
24 | $ write sys$output "" | ||
25 | $ write sys$output "make a certificate request using 'req'" | ||
26 | $ | ||
27 | $ set noon | ||
28 | $ define/user sys$output nla0: | ||
29 | $ mcr 'exe_dir'openssl no-rsa | ||
30 | $ save_severity=$SEVERITY | ||
31 | $ set on | ||
32 | $ if save_severity | ||
33 | $ then | ||
34 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
35 | $ else | ||
36 | $ req_new="-new" | ||
37 | $ endif | ||
38 | $ | ||
39 | $ 'reqcmd' -config 'CAconf' -out 'CAreq' -keyout 'CAkey' 'req_new' ! -out err.ss | ||
40 | $ if $severity .ne. 1 | ||
41 | $ then | ||
42 | $ write sys$output "error using 'req' to generate a certificate request" | ||
43 | $ exit 3 | ||
44 | $ endif | ||
45 | $ write sys$output "" | ||
46 | $ write sys$output "convert the certificate request into a self signed certificate using 'x509'" | ||
47 | $ define /user sys$output err.ss | ||
48 | $ 'x509cmd' "-CAcreateserial" -in 'CAreq' -days 30 -req -out 'CAcert' -signkey 'CAkey' | ||
49 | $ if $severity .ne. 1 | ||
50 | $ then | ||
51 | $ write sys$output "error using 'x509' to self sign a certificate request" | ||
52 | $ exit 3 | ||
53 | $ endif | ||
54 | $ | ||
55 | $ write sys$output "" | ||
56 | $ write sys$output "convert a certificate into a certificate request using 'x509'" | ||
57 | $ define /user sys$output err.ss | ||
58 | $ 'x509cmd' -in 'CAcert' -x509toreq -signkey 'CAkey' -out 'CAreq2' | ||
59 | $ if $severity .ne. 1 | ||
60 | $ then | ||
61 | $ write sys$output "error using 'x509' convert a certificate to a certificate request" | ||
62 | $ exit 3 | ||
63 | $ endif | ||
64 | $ | ||
65 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq' -noout | ||
66 | $ if $severity .ne. 1 | ||
67 | $ then | ||
68 | $ write sys$output "first generated request is invalid" | ||
69 | $ exit 3 | ||
70 | $ endif | ||
71 | $ | ||
72 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq2' -noout | ||
73 | $ if $severity .ne. 1 | ||
74 | $ then | ||
75 | $ write sys$output "second generated request is invalid" | ||
76 | $ exit 3 | ||
77 | $ endif | ||
78 | $ | ||
79 | $ 'verifycmd' "-CAfile" 'CAcert' 'CAcert' | ||
80 | $ if $severity .ne. 1 | ||
81 | $ then | ||
82 | $ write sys$output "first generated cert is invalid" | ||
83 | $ exit 3 | ||
84 | $ endif | ||
85 | $ | ||
86 | $ write sys$output "" | ||
87 | $ write sys$output "make another certificate request using 'req'" | ||
88 | $ define /user sys$output err.ss | ||
89 | $ 'reqcmd' -config 'Uconf' -out 'Ureq' -keyout 'Ukey' 'req_new' | ||
90 | $ if $severity .ne. 1 | ||
91 | $ then | ||
92 | $ write sys$output "error using 'req' to generate a certificate request" | ||
93 | $ exit 3 | ||
94 | $ endif | ||
95 | $ | ||
96 | $ write sys$output "" | ||
97 | $ write sys$output "sign certificate request with the just created CA via 'x509'" | ||
98 | $ define /user sys$output err.ss | ||
99 | $ 'x509cmd' "-CAcreateserial" -in 'Ureq' -days 30 -req -out 'Ucert' "-CA" 'CAcert' "-CAkey" 'CAkey' | ||
100 | $ if $severity .ne. 1 | ||
101 | $ then | ||
102 | $ write sys$output "error using 'x509' to sign a certificate request" | ||
103 | $ exit 3 | ||
104 | $ endif | ||
105 | $ | ||
106 | $ 'verifycmd' "-CAfile" 'CAcert' 'Ucert' | ||
107 | $ write sys$output "" | ||
108 | $ write sys$output "Certificate details" | ||
109 | $ 'x509cmd' -subject -issuer -startdate -enddate -noout -in 'Ucert' | ||
110 | $ | ||
111 | $ write sys$output "" | ||
112 | $ write sys$output "The generated CA certificate is ",CAcert | ||
113 | $ write sys$output "The generated CA private key is ",CAkey | ||
114 | $ | ||
115 | $ write sys$output "The generated user certificate is ",Ucert | ||
116 | $ write sys$output "The generated user private key is ",Ukey | ||
117 | $ | ||
118 | $ if f$search("err.ss;*") .nes. "" then delete err.ss;* | ||
diff --git a/src/lib/libssl/test/testssl.com b/src/lib/libssl/test/testssl.com new file mode 100644 index 0000000000..26308f7715 --- /dev/null +++ b/src/lib/libssl/test/testssl.com | |||
@@ -0,0 +1,204 @@ | |||
1 | $! TESTSSL.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | ||
6 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
7 | $ | ||
8 | $ if p1 .eqs. "" | ||
9 | $ then | ||
10 | $ key="[-.apps]server.pem" | ||
11 | $ else | ||
12 | $ key=p1 | ||
13 | $ endif | ||
14 | $ if p2 .eqs. "" | ||
15 | $ then | ||
16 | $ cert="[-.apps]server.pem" | ||
17 | $ else | ||
18 | $ cert=p2 | ||
19 | $ endif | ||
20 | $ ssltest := mcr 'texe_dir'ssltest -key 'key' -cert 'cert' -c_key 'key' -c_cert 'cert' | ||
21 | $ | ||
22 | $ define/user sys$output testssl-x509-output. | ||
23 | $ define/user sys$error nla0: | ||
24 | $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout | ||
25 | $ set noon | ||
26 | $ define/user sys$error nla0: | ||
27 | $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact | ||
28 | $ if $severity .eq. 1 | ||
29 | $ then | ||
30 | $ dsa_cert := YES | ||
31 | $ else | ||
32 | $ dsa_cert := NO | ||
33 | $ endif | ||
34 | $ set on | ||
35 | $ delete testssl-x509-output.;* | ||
36 | $ | ||
37 | $ if p3 .eqs. "" | ||
38 | $ then | ||
39 | $ copy/concatenate [-.certs]*.pem certs.tmp | ||
40 | $ CA = """-CAfile"" certs.tmp" | ||
41 | $ else | ||
42 | $ CA = """-CAfile"" "+p3 | ||
43 | $ endif | ||
44 | $ | ||
45 | $!########################################################################### | ||
46 | $ | ||
47 | $ write sys$output "test sslv2" | ||
48 | $ 'ssltest' -ssl2 | ||
49 | $ if $severity .ne. 1 then goto exit3 | ||
50 | $ | ||
51 | $ write sys$output "test sslv2 with server authentication" | ||
52 | $ 'ssltest' -ssl2 -server_auth 'CA' | ||
53 | $ if $severity .ne. 1 then goto exit3 | ||
54 | $ | ||
55 | $ if .not. dsa_cert | ||
56 | $ then | ||
57 | $ write sys$output "test sslv2 with client authentication" | ||
58 | $ 'ssltest' -ssl2 -client_auth 'CA' | ||
59 | $ if $severity .ne. 1 then goto exit3 | ||
60 | $ | ||
61 | $ write sys$output "test sslv2 with both client and server authentication" | ||
62 | $ 'ssltest' -ssl2 -server_auth -client_auth 'CA' | ||
63 | $ if $severity .ne. 1 then goto exit3 | ||
64 | $ endif | ||
65 | $ | ||
66 | $ write sys$output "test sslv3" | ||
67 | $ 'ssltest' -ssl3 | ||
68 | $ if $severity .ne. 1 then goto exit3 | ||
69 | $ | ||
70 | $ write sys$output "test sslv3 with server authentication" | ||
71 | $ 'ssltest' -ssl3 -server_auth 'CA' | ||
72 | $ if $severity .ne. 1 then goto exit3 | ||
73 | $ | ||
74 | $ write sys$output "test sslv3 with client authentication" | ||
75 | $ 'ssltest' -ssl3 -client_auth 'CA' | ||
76 | $ if $severity .ne. 1 then goto exit3 | ||
77 | $ | ||
78 | $ write sys$output "test sslv3 with both client and server authentication" | ||
79 | $ 'ssltest' -ssl3 -server_auth -client_auth 'CA' | ||
80 | $ if $severity .ne. 1 then goto exit3 | ||
81 | $ | ||
82 | $ write sys$output "test sslv2/sslv3" | ||
83 | $ 'ssltest' | ||
84 | $ if $severity .ne. 1 then goto exit3 | ||
85 | $ | ||
86 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
87 | $ 'ssltest' -server_auth 'CA' | ||
88 | $ if $severity .ne. 1 then goto exit3 | ||
89 | $ | ||
90 | $ write sys$output "test sslv2/sslv3 with client authentication" | ||
91 | $ 'ssltest' -client_auth 'CA' | ||
92 | $ if $severity .ne. 1 then goto exit3 | ||
93 | $ | ||
94 | $ write sys$output "test sslv2/sslv3 with both client and server authentication" | ||
95 | $ 'ssltest' -server_auth -client_auth 'CA' | ||
96 | $ if $severity .ne. 1 then goto exit3 | ||
97 | $ | ||
98 | $ write sys$output "test sslv2 via BIO pair" | ||
99 | $ 'ssltest' -bio_pair -ssl2 | ||
100 | $ if $severity .ne. 1 then goto exit3 | ||
101 | $ | ||
102 | $ write sys$output "test sslv2 with server authentication via BIO pair" | ||
103 | $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA' | ||
104 | $ if $severity .ne. 1 then goto exit3 | ||
105 | $ | ||
106 | $ if .not. dsa_cert | ||
107 | $ then | ||
108 | $ write sys$output "test sslv2 with client authentication via BIO pair" | ||
109 | $ 'ssltest' -bio_pair -ssl2 -client_auth 'CA' | ||
110 | $ if $severity .ne. 1 then goto exit3 | ||
111 | $ | ||
112 | $ write sys$output "test sslv2 with both client and server authentication via BIO pair" | ||
113 | $ 'ssltest' -bio_pair -ssl2 -server_auth -client_auth 'CA' | ||
114 | $ if $severity .ne. 1 then goto exit3 | ||
115 | $ endif | ||
116 | $ | ||
117 | $ write sys$output "test sslv3 via BIO pair" | ||
118 | $ 'ssltest' -bio_pair -ssl3 | ||
119 | $ if $severity .ne. 1 then goto exit3 | ||
120 | $ | ||
121 | $ write sys$output "test sslv3 with server authentication via BIO pair" | ||
122 | $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA' | ||
123 | $ if $severity .ne. 1 then goto exit3 | ||
124 | $ | ||
125 | $ write sys$output "test sslv3 with client authentication via BIO pair" | ||
126 | $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA' | ||
127 | $ if $severity .ne. 1 then goto exit3 | ||
128 | |||
129 | $ write sys$output "test sslv3 with both client and server authentication via BIO pair" | ||
130 | $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA' | ||
131 | $ if $severity .ne. 1 then goto exit3 | ||
132 | $ | ||
133 | $ write sys$output "test sslv2/sslv3 via BIO pair" | ||
134 | $ 'ssltest' | ||
135 | $ if $severity .ne. 1 then goto exit3 | ||
136 | $ | ||
137 | $ if .not. dsa_cert | ||
138 | $ then | ||
139 | $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" | ||
140 | $ 'ssltest' -bio_pair -no_dhe | ||
141 | $ if $severity .ne. 1 then goto exit3 | ||
142 | $ endif | ||
143 | $ | ||
144 | $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" | ||
145 | $ 'ssltest' -bio_pair -dhe1024dsa -v | ||
146 | $ if $severity .ne. 1 then goto exit3 | ||
147 | $ | ||
148 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
149 | $ 'ssltest' -bio_pair -server_auth 'CA' | ||
150 | $ if $severity .ne. 1 then goto exit3 | ||
151 | $ | ||
152 | $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair" | ||
153 | $ 'ssltest' -bio_pair -client_auth 'CA' | ||
154 | $ if $severity .ne. 1 then goto exit3 | ||
155 | $ | ||
156 | $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair" | ||
157 | $ 'ssltest' -bio_pair -server_auth -client_auth 'CA' | ||
158 | $ if $severity .ne. 1 then goto exit3 | ||
159 | $ | ||
160 | $!########################################################################### | ||
161 | $ | ||
162 | $ set noon | ||
163 | $ define/user sys$output nla0: | ||
164 | $ mcr 'exe_dir'openssl no-rsa | ||
165 | $ no_rsa=$SEVERITY | ||
166 | $ define/user sys$output nla0: | ||
167 | $ mcr 'exe_dir'openssl no-dh | ||
168 | $ no_dh=$SEVERITY | ||
169 | $ set on | ||
170 | $ | ||
171 | $ if no_dh | ||
172 | $ then | ||
173 | $ write sys$output "skipping anonymous DH tests" | ||
174 | $ else | ||
175 | $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes" | ||
176 | $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time | ||
177 | $ if $severity .ne. 1 then goto exit3 | ||
178 | $ endif | ||
179 | $ | ||
180 | $ if no_rsa | ||
181 | $ then | ||
182 | $ write sys$output "skipping RSA tests" | ||
183 | $ else | ||
184 | $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes" | ||
185 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time | ||
186 | $ if $severity .ne. 1 then goto exit3 | ||
187 | $ | ||
188 | $ if no_dh | ||
189 | $ then | ||
190 | $ write sys$output "skipping RSA+DHE tests" | ||
191 | $ else | ||
192 | $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes" | ||
193 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time | ||
194 | $ if $severity .ne. 1 then goto exit3 | ||
195 | $ endif | ||
196 | $ endif | ||
197 | $ | ||
198 | $ RET = 1 | ||
199 | $ goto exit | ||
200 | $ exit3: | ||
201 | $ RET = 3 | ||
202 | $ exit: | ||
203 | $ if p3 .eqs. "" then delete certs.tmp;* | ||
204 | $ exit 'RET' | ||
diff --git a/src/lib/libssl/test/tpkcs7.com b/src/lib/libssl/test/tpkcs7.com new file mode 100644 index 0000000000..047834fba4 --- /dev/null +++ b/src/lib/libssl/test/tpkcs7.com | |||
@@ -0,0 +1,54 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
8 | $ | ||
9 | $ t := testp7.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing PKCS7 conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> p" | ||
24 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ | ||
27 | $ write sys$output "d -> d" | ||
28 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
29 | $ if $severity .ne. 1 then exit 3 | ||
30 | $ write sys$output "p -> d" | ||
31 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ | ||
34 | $ | ||
35 | $ write sys$output "d -> p" | ||
36 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
37 | $ if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> p" | ||
39 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $ backup/compare fff.p f.p | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $ backup/compare fff.p ff.p1 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ backup/compare fff.p ff.p3 | ||
47 | $ if $severity .ne. 1 then exit 3 | ||
48 | $ | ||
49 | $ backup/compare f.p ff.p1 | ||
50 | $ if $severity .ne. 1 then exit 3 | ||
51 | $ backup/compare f.p ff.p3 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $ | ||
54 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tpkcs7d.com b/src/lib/libssl/test/tpkcs7d.com new file mode 100644 index 0000000000..193bb72137 --- /dev/null +++ b/src/lib/libssl/test/tpkcs7d.com | |||
@@ -0,0 +1,47 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
8 | $ | ||
9 | $ t := pkcs7-1.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing PKCS7 conversions (2)" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> p" | ||
24 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ | ||
27 | $ write sys$output "d -> d" | ||
28 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
29 | $ if $severity .ne. 1 then exit 3 | ||
30 | $ write sys$output "p -> d" | ||
31 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ | ||
34 | $ | ||
35 | $ write sys$output "d -> p" | ||
36 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
37 | $ if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> p" | ||
39 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $ backup/compare f.p ff.p1 | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $ backup/compare f.p ff.p3 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ | ||
47 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/treq.com b/src/lib/libssl/test/treq.com new file mode 100644 index 0000000000..5524e485ba --- /dev/null +++ b/src/lib/libssl/test/treq.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TREQ.COM -- Tests req keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl req -config [-.apps]openssl-vms.cnf | ||
8 | $ | ||
9 | $ t := testreq.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing req conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -verify -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -verify -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -verify -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/trsa.com b/src/lib/libssl/test/trsa.com new file mode 100644 index 0000000000..6dbe59ef64 --- /dev/null +++ b/src/lib/libssl/test/trsa.com | |||
@@ -0,0 +1,94 @@ | |||
1 | $! TRSA.COM -- Tests rsa keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ set noon | ||
8 | $ define/user sys$output nla0: | ||
9 | $ mcr 'exe_dir'openssl no-rsa | ||
10 | $ save_severity=$SEVERITY | ||
11 | $ set on | ||
12 | $ if save_severity | ||
13 | $ then | ||
14 | $ write sys$output "skipping RSA conversion test" | ||
15 | $ exit | ||
16 | $ endif | ||
17 | $ | ||
18 | $ cmd := mcr 'exe_dir'openssl rsa | ||
19 | $ | ||
20 | $ t := testrsa.pem | ||
21 | $ if p1 .nes. "" then t = p1 | ||
22 | $ | ||
23 | $ write sys$output "testing RSA conversions" | ||
24 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
25 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
26 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
27 | $ convert/fdl=sys$input: 't' fff.p | ||
28 | RECORD | ||
29 | FORMAT STREAM_LF | ||
30 | $ | ||
31 | $ write sys$output "p -> d" | ||
32 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
33 | $ if $severity .ne. 1 then exit 3 | ||
34 | $! write sys$output "p -> t" | ||
35 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
36 | $! if $severity .ne. 1 then exit 3 | ||
37 | $ write sys$output "p -> p" | ||
38 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
39 | $ if $severity .ne. 1 then exit 3 | ||
40 | $ | ||
41 | $ write sys$output "d -> d" | ||
42 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $! write sys$output "t -> d" | ||
45 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
46 | $! if $severity .ne. 1 then exit 3 | ||
47 | $ write sys$output "p -> d" | ||
48 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
49 | $ if $severity .ne. 1 then exit 3 | ||
50 | $ | ||
51 | $! write sys$output "d -> t" | ||
52 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
53 | $! if $severity .ne. 1 then exit 3 | ||
54 | $! write sys$output "t -> t" | ||
55 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
56 | $! if $severity .ne. 1 then exit 3 | ||
57 | $! write sys$output "p -> t" | ||
58 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
59 | $! if $severity .ne. 1 then exit 3 | ||
60 | $ | ||
61 | $ write sys$output "d -> p" | ||
62 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! write sys$output "t -> p" | ||
65 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
66 | $! if $severity .ne. 1 then exit 3 | ||
67 | $ write sys$output "p -> p" | ||
68 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $ backup/compare fff.p f.p | ||
72 | $ if $severity .ne. 1 then exit 3 | ||
73 | $ backup/compare fff.p ff.p1 | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $! backup/compare fff.p ff.p2 | ||
76 | $! if $severity .ne. 1 then exit 3 | ||
77 | $ backup/compare fff.p ff.p3 | ||
78 | $ if $severity .ne. 1 then exit 3 | ||
79 | $ | ||
80 | $! backup/compare f.t ff.t1 | ||
81 | $! if $severity .ne. 1 then exit 3 | ||
82 | $! backup/compare f.t ff.t2 | ||
83 | $! if $severity .ne. 1 then exit 3 | ||
84 | $! backup/compare f.t ff.t3 | ||
85 | $! if $severity .ne. 1 then exit 3 | ||
86 | $ | ||
87 | $ backup/compare f.p ff.p1 | ||
88 | $ if $severity .ne. 1 then exit 3 | ||
89 | $! backup/compare f.p ff.p2 | ||
90 | $! if $severity .ne. 1 then exit 3 | ||
91 | $ backup/compare f.p ff.p3 | ||
92 | $ if $severity .ne. 1 then exit 3 | ||
93 | $ | ||
94 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tsid.com b/src/lib/libssl/test/tsid.com new file mode 100644 index 0000000000..abd1d4d737 --- /dev/null +++ b/src/lib/libssl/test/tsid.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TSID.COM -- Tests sid keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl sess_id | ||
8 | $ | ||
9 | $ t := testsid.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing session-id conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tverify.com b/src/lib/libssl/test/tverify.com new file mode 100644 index 0000000000..f97e71478f --- /dev/null +++ b/src/lib/libssl/test/tverify.com | |||
@@ -0,0 +1,26 @@ | |||
1 | $! TVERIFY.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ copy/concatenate [-.certs]*.pem certs.tmp | ||
8 | $ | ||
9 | $ old_f := | ||
10 | $ loop_certs: | ||
11 | $ c := NO | ||
12 | $ certs := | ||
13 | $ loop_certs2: | ||
14 | $ f = f$search("[-.certs]*.pem") | ||
15 | $ if f .nes. "" .and. f .nes. old_f | ||
16 | $ then | ||
17 | $ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem" | ||
18 | $ if f$length(certs) .lt. 180 then goto loop_certs2 | ||
19 | $ c := YES | ||
20 | $ endif | ||
21 | $ certs = certs - " " | ||
22 | $ | ||
23 | $ mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs' | ||
24 | $ if c then goto loop_certs | ||
25 | $ | ||
26 | $ delete certs.tmp;* | ||
diff --git a/src/lib/libssl/test/tx509.com b/src/lib/libssl/test/tx509.com new file mode 100644 index 0000000000..7b2592f773 --- /dev/null +++ b/src/lib/libssl/test/tx509.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TX509.COM -- Tests x509 certificates | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl x509 | ||
8 | $ | ||
9 | $ t := testx509.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing X509 conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> n" | ||
24 | $ 'cmd' -in fff.p -inform p -outform n -out f.n | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ write sys$output "n -> d" | ||
34 | $ 'cmd' -in f.n -inform n -outform d -out ff.d2 | ||
35 | $ if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $ write sys$output "d -> n" | ||
41 | $ 'cmd' -in f.d -inform d -outform n -out ff.n1 | ||
42 | $ if $severity .ne. 1 then exit 3 | ||
43 | $ write sys$output "n -> n" | ||
44 | $ 'cmd' -in f.n -inform n -outform n -out ff.n2 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ write sys$output "p -> n" | ||
47 | $ 'cmd' -in f.p -inform p -outform n -out ff.n3 | ||
48 | $ if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $ write sys$output "n -> p" | ||
54 | $ 'cmd' -in f.n -inform n -outform p -out ff.p2 | ||
55 | $ if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p2 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $ backup/compare f.n ff.n1 | ||
70 | $ if $severity .ne. 1 then exit 3 | ||
71 | $ backup/compare f.n ff.n2 | ||
72 | $ if $severity .ne. 1 then exit 3 | ||
73 | $ backup/compare f.n ff.n3 | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $ backup/compare f.p ff.p2 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||