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