Change PKCS#7 test data to take account of removal of
[openssl.git] / test / Makefile.ssl
1 #
2 # test/Makefile.ssl
3 #
4
5 DIR=            test
6 TOP=            ..
7 CC=             cc
8 INCLUDES=       -I../include
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 MAKEDEPEND=     $(TOP)/util/domd $(TOP)
16 PERL=           perl
17
18 PEX_LIBS=
19 EX_LIBS= #-lnsl -lsocket
20
21 CFLAGS= $(INCLUDES) $(CFLAG)
22
23 GENERAL=Makefile.ssl maketests.com \
24         tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \
25         tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \
26         testca.com VMSca-response.1 VMSca-response.2
27
28 DLIBCRYPTO= ../libcrypto.a
29 DLIBSSL= ../libssl.a
30 LIBCRYPTO= -L.. -lcrypto
31 LIBSSL= -L.. -lssl
32
33 BNTEST=         bntest
34 EXPTEST=        exptest
35 IDEATEST=       ideatest
36 SHATEST=        shatest
37 SHA1TEST=       sha1test
38 MDC2TEST=       mdc2test
39 RMDTEST=        rmdtest
40 MD2TEST=        md2test
41 MD4TEST=        md4test
42 MD5TEST=        md5test
43 HMACTEST=       hmactest
44 RC2TEST=        rc2test
45 RC4TEST=        rc4test
46 RC5TEST=        rc5test
47 BFTEST=         bftest
48 CASTTEST=       casttest
49 DESTEST=        destest
50 RANDTEST=       randtest
51 DHTEST=         dhtest
52 DSATEST=        dsatest
53 METHTEST=       methtest
54 SSLTEST=        ssltest
55 RSATEST=        rsa_test
56
57 EXE=    $(BNTEST) $(IDEATEST) $(MD2TEST)  $(MD4TEST) $(MD5TEST) $(HMACTEST) \
58         $(RC2TEST) $(RC4TEST) $(RC5TEST) \
59         $(DESTEST) $(SHATEST) $(SHA1TEST) $(MDC2TEST) $(RMDTEST) \
60         $(RANDTEST) $(DHTEST) \
61         $(BFTEST) $(CASTTEST) $(SSLTEST) $(EXPTEST) $(DSATEST) $(RSATEST)
62
63 # $(METHTEST)
64
65 OBJ=    $(BNTEST).o $(IDEATEST).o $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \
66         $(HMACTEST).o \
67         $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \
68         $(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(MDC2TEST).o $(RMDTEST).o \
69         $(RANDTEST).o $(DHTEST).o $(CASTTEST).o \
70         $(BFTEST).o  $(SSLTEST).o  $(DSATEST).o  $(EXPTEST).o $(RSATEST).o
71 SRC=    $(BNTEST).c $(IDEATEST).c $(MD2TEST).c  $(MD4TEST).c $(MD5TEST).c \
72         $(HMACTEST).c \
73         $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \
74         $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
75         $(RANDTEST).c $(DHTEST).c $(CASTTEST).c \
76         $(BFTEST).c  $(SSLTEST).c $(DSATEST).c   $(EXPTEST).c $(RSATEST).c
77
78 EXHEADER= 
79 HEADER= $(EXHEADER)
80
81 ALL=    $(GENERAL) $(SRC) $(HEADER)
82
83 top:
84         (cd ..; $(MAKE) DIRS=$(DIR) all)
85
86 all:    exe
87
88 exe:    $(EXE)
89
90 files:
91         $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
92
93 links:
94         @@$(TOP)/util/point.sh Makefile.ssl Makefile
95
96 errors:
97
98 install:
99
100 tags:
101         ctags $(SRC)
102
103 tests:  exe apps \
104         test_des test_idea test_sha test_md4 test_md5 test_hmac \
105         test_md2 test_mdc2 \
106         test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast \
107         test_rand test_bn test_enc test_x509 test_rsa test_crl test_sid \
108         test_gen test_req test_pkcs7 test_verify test_dh test_dsa \
109         test_ss test_ca test_ssl
110
111 apps:
112         @(cd ../apps; $(MAKE)  CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all)
113
114 test_des:
115         ./$(DESTEST)
116
117 test_idea:
118         ./$(IDEATEST)
119
120 test_sha:
121         ./$(SHATEST)
122         ./$(SHA1TEST)
123
124 test_mdc2:
125         ./$(MDC2TEST)
126
127 test_md5:
128         ./$(MD5TEST)
129
130 test_md4:
131         ./$(MD4TEST)
132
133 test_hmac:
134         ./$(HMACTEST)
135
136 test_md2:
137         ./$(MD2TEST)
138
139 test_rmd:
140         ./$(RMDTEST)
141
142 test_bf:
143         ./$(BFTEST)
144
145 test_cast:
146         ./$(CASTTEST)
147
148 test_rc2:
149         ./$(RC2TEST)
150
151 test_rc4:
152         ./$(RC4TEST)
153
154 test_rc5:
155         ./$(RC5TEST)
156
157 test_rand:
158         ./$(RANDTEST)
159
160 test_enc:
161         @sh ./testenc
162
163 test_x509:
164         echo test normal x509v1 certificate
165         sh ./tx509 2>/dev/null
166         echo test first x509v3 certificate
167         sh ./tx509 v3-cert1.pem 2>/dev/null
168         echo test second x509v3 certificate
169         sh ./tx509 v3-cert2.pem 2>/dev/null
170
171 test_rsa:
172         @sh ./trsa 2>/dev/null
173         ./$(RSATEST)
174
175 test_crl:
176         @sh ./tcrl 2>/dev/null
177
178 test_sid:
179         @sh ./tsid 2>/dev/null
180
181 test_req:
182         @sh ./treq 2>/dev/null
183         @sh ./treq testreq2.pem 2>/dev/null
184
185 test_pkcs7:
186         @sh ./tpkcs7 2>/dev/null
187         @sh ./tpkcs7d 2>/dev/null
188
189 test_bn:
190         @echo starting big number library test, could take a while...
191         @./$(BNTEST) >tmp.bntest
192         @echo quit >>tmp.bntest
193         @echo "running bc"
194         @bc tmp.bntest 2>&1 | $(PERL) -e 'while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} print STDERR "."; $$i++;} print STDERR "\n$$i tests passed\n"'
195         @echo 'test a^b%c implementations'
196         ./$(EXPTEST)
197
198 test_verify:
199         @echo "The following command should have some OK's and some failures"
200         @echo "There are definitly a few expired certificates"
201         ../apps/openssl verify -CApath ../certs ../certs/*.pem
202
203 test_dh:
204         @echo "Generate a set of DH parameters"
205         ./$(DHTEST)
206
207 test_dsa:
208         @echo "Generate a set of DSA parameters"
209         ./$(DSATEST)
210         ./$(DSATEST) -app2_1
211
212 test_gen:
213         @echo "Generate and verify a certificate request"
214         @sh ./testgen
215
216 test_ss keyU.ss certU.ss certCA.ss: testss
217         @echo "Generate and certify a test certificate"
218         @sh ./testss
219
220 test_ssl: keyU.ss certU.ss certCA.ss
221         @echo "test SSL protocol"
222         @sh ./testssl keyU.ss certU.ss certCA.ss
223
224 test_ca:
225         @if ../apps/openssl no-rsa; then \
226           echo "skipping CA.sh test -- requires RSA"; \
227         else \
228           echo "Generate and certify a test certificate via the 'ca' program"; \
229           sh ./testca; \
230         fi
231
232 lint:
233         lint -DLINT $(INCLUDES) $(SRC)>fluff
234
235 depend:
236         $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(SRC)
237
238 dclean:
239         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
240         mv -f Makefile.new $(MAKEFILE)
241
242 clean:
243         rm -f .rnd tmp.bntest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log
244
245 $(DLIBSSL):
246         (cd ../ssl; $(MAKE))
247
248 $(DLIBCRYPTO):
249         (cd ../crypto; $(MAKE))
250
251 $(RSATEST): $(RSATEST).o $(DLIBCRYPTO)
252         $(CC) -o $(RSATEST) $(CFLAGS) $(RSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
253
254 $(BNTEST): $(BNTEST).o $(DLIBCRYPTO)
255         $(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
256
257 $(EXPTEST): $(EXPTEST).o $(DLIBCRYPTO)
258         $(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
259
260 $(IDEATEST): $(IDEATEST).o $(DLIBCRYPTO)
261         $(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
262
263 $(MD2TEST): $(MD2TEST).o $(DLIBCRYPTO)
264         $(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
265
266 $(SHATEST): $(SHATEST).o $(DLIBCRYPTO)
267         $(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
268
269 $(SHA1TEST): $(SHA1TEST).o $(DLIBCRYPTO)
270         $(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
271
272 $(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO)
273         $(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
274
275 $(MDC2TEST): $(MDC2TEST).o $(DLIBCRYPTO)
276         $(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
277
278 $(MD4TEST): $(MD4TEST).o $(DLIBCRYPTO)
279         $(CC) -o $(MD4TEST) $(CFLAGS) $(MD4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
280
281 $(MD5TEST): $(MD5TEST).o $(DLIBCRYPTO)
282         $(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
283
284 $(HMACTEST): $(HMACTEST).o $(DLIBCRYPTO)
285         $(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
286
287 $(RC2TEST): $(RC2TEST).o $(DLIBCRYPTO)
288         $(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
289
290 $(BFTEST): $(BFTEST).o $(DLIBCRYPTO)
291         $(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
292
293 $(CASTTEST): $(CASTTEST).o $(DLIBCRYPTO)
294         $(CC) -o $(CASTTEST) $(CFLAGS) $(CASTTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
295
296 $(RC4TEST): $(RC4TEST).o $(DLIBCRYPTO)
297         $(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
298
299 $(RC5TEST): $(RC5TEST).o $(DLIBCRYPTO)
300         $(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
301
302 $(DESTEST): $(DESTEST).o $(DLIBCRYPTO)
303         $(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
304
305 $(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO)
306         $(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
307
308 $(DHTEST): $(DHTEST).o $(DLIBCRYPTO)
309         $(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
310
311 $(DSATEST): $(DSATEST).o $(DLIBCRYPTO)
312         $(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
313
314 $(METHTEST): $(METHTEST).o $(DLIBCRYPTO)
315         $(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
316
317 $(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
318         $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
319
320 # DO NOT DELETE THIS LINE -- make depend depends on it.
321
322 bftest.o: ../include/openssl/blowfish.h
323 bntest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
324 bntest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
325 bntest.o: ../include/openssl/buffer.h ../include/openssl/cast.h
326 bntest.o: ../include/openssl/crypto.h ../include/openssl/des.h
327 bntest.o: ../include/openssl/dh.h ../include/openssl/dsa.h
328 bntest.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
329 bntest.o: ../include/openssl/err.h ../include/openssl/evp.h
330 bntest.o: ../include/openssl/idea.h ../include/openssl/lhash.h
331 bntest.o: ../include/openssl/md2.h ../include/openssl/md4.h
332 bntest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
333 bntest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
334 bntest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
335 bntest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
336 bntest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
337 bntest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
338 bntest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
339 bntest.o: ../include/openssl/sha.h ../include/openssl/stack.h
340 bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
341 casttest.o: ../include/openssl/cast.h
342 destest.o: ../include/openssl/des.h ../include/openssl/e_os2.h
343 destest.o: ../include/openssl/opensslconf.h
344 dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h
345 dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
346 dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
347 dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
348 dhtest.o: ../include/openssl/stack.h
349 dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h
350 dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
351 dsatest.o: ../include/openssl/dsa.h ../include/openssl/err.h
352 dsatest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
353 dsatest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
354 dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
355 exptest.o: ../include/openssl/bio.h ../include/openssl/bn.h
356 exptest.o: ../include/openssl/crypto.h ../include/openssl/err.h
357 exptest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
358 exptest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
359 exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
360 hmactest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
361 hmactest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
362 hmactest.o: ../include/openssl/cast.h ../include/openssl/crypto.h
363 hmactest.o: ../include/openssl/des.h ../include/openssl/dh.h
364 hmactest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
365 hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
366 hmactest.o: ../include/openssl/idea.h ../include/openssl/md2.h
367 hmactest.o: ../include/openssl/md4.h ../include/openssl/md5.h
368 hmactest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
369 hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
370 hmactest.o: ../include/openssl/opensslv.h ../include/openssl/rc2.h
371 hmactest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
372 hmactest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
373 hmactest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
374 hmactest.o: ../include/openssl/stack.h
375 ideatest.o: ../include/openssl/idea.h ../include/openssl/opensslconf.h
376 md2test.o: ../include/openssl/md2.h ../include/openssl/opensslconf.h
377 md4test.o: ../include/openssl/md4.h
378 md5test.o: ../include/openssl/md5.h
379 mdc2test.o: ../include/openssl/des.h ../include/openssl/e_os2.h
380 mdc2test.o: ../include/openssl/mdc2.h ../include/openssl/opensslconf.h
381 randtest.o: ../include/openssl/rand.h
382 rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h
383 rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h
384 rc5test.o: ../include/openssl/rc5.h
385 rmdtest.o: ../include/openssl/ripemd.h
386 rsa_test.o: ../include/openssl/bio.h ../include/openssl/bn.h
387 rsa_test.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
388 rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h
389 rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
390 rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
391 rsa_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
392 rsa_test.o: ../include/openssl/stack.h
393 sha1test.o: ../include/openssl/sha.h
394 shatest.o: ../include/openssl/sha.h
395 ssltest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
396 ssltest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
397 ssltest.o: ../include/openssl/buffer.h ../include/openssl/cast.h
398 ssltest.o: ../include/openssl/comp.h ../include/openssl/crypto.h
399 ssltest.o: ../include/openssl/des.h ../include/openssl/dh.h
400 ssltest.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
401 ssltest.o: ../include/openssl/e_os2.h ../include/openssl/err.h
402 ssltest.o: ../include/openssl/evp.h ../include/openssl/idea.h
403 ssltest.o: ../include/openssl/lhash.h ../include/openssl/md2.h
404 ssltest.o: ../include/openssl/md4.h ../include/openssl/md5.h
405 ssltest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
406 ssltest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
407 ssltest.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
408 ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
409 ssltest.o: ../include/openssl/rand.h ../include/openssl/rc2.h
410 ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
411 ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
412 ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
413 ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
414 ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
415 ssltest.o: ../include/openssl/stack.h ../include/openssl/tls1.h
416 ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h