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