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)
19 EX_LIBS= #-lnsl -lsocket
21 CFLAGS= $(INCLUDES) $(CFLAG)
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
28 DLIBCRYPTO= ../libcrypto.a
30 LIBCRYPTO= -L.. -lcrypto
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)
65 OBJ= $(BNTEST).o $(IDEATEST).o $(MD2TEST).o $(MD4TEST).o $(MD5TEST).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 \
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
81 ALL= $(GENERAL) $(SRC) $(HEADER)
84 (cd ..; $(MAKE) DIRS=$(DIR) all)
91 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
94 @@$(TOP)/util/point.sh Makefile.ssl Makefile
104 test_des test_idea test_sha test_md4 test_md5 test_hmac \
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
112 @(cd ../apps; $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all)
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
172 @sh ./trsa 2>/dev/null
176 @sh ./tcrl 2>/dev/null
179 @sh ./tsid 2>/dev/null
182 @sh ./treq 2>/dev/null
183 @sh ./treq testreq2.pem 2>/dev/null
186 @sh ./tpkcs7 2>/dev/null
187 @sh ./tpkcs7d 2>/dev/null
190 @echo starting big number library test, could take a while...
191 @./$(BNTEST) >tmp.bntest
192 @echo quit >>tmp.bntest
194 @<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"'
195 @echo 'test a^b%c implementations'
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
204 @echo "Generate a set of DH parameters"
208 @echo "Generate a set of DSA parameters"
213 @echo "Generate and verify a certificate request"
216 test_ss keyU.ss certU.ss certCA.ss: testss
217 @echo "Generate and certify a test certificate"
220 test_ssl: keyU.ss certU.ss certCA.ss
221 @echo "test SSL protocol"
222 @sh ./testssl keyU.ss certU.ss certCA.ss
225 @if ../apps/openssl no-rsa; then \
226 echo "skipping CA.sh test -- requires RSA"; \
228 echo "Generate and certify a test certificate via the 'ca' program"; \
233 lint -DLINT $(INCLUDES) $(SRC)>fluff
236 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(SRC)
239 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
240 mv -f Makefile.new $(MAKEFILE)
243 rm -f .rnd tmp.bntest tmp.bctest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log
249 (cd ../crypto; $(MAKE))
251 $(RSATEST): $(RSATEST).o $(DLIBCRYPTO)
252 $(CC) -o $(RSATEST) $(CFLAGS) $(RSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
254 $(BNTEST): $(BNTEST).o $(DLIBCRYPTO)
255 $(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
257 $(EXPTEST): $(EXPTEST).o $(DLIBCRYPTO)
258 $(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
260 $(IDEATEST): $(IDEATEST).o $(DLIBCRYPTO)
261 $(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
263 $(MD2TEST): $(MD2TEST).o $(DLIBCRYPTO)
264 $(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
266 $(SHATEST): $(SHATEST).o $(DLIBCRYPTO)
267 $(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
269 $(SHA1TEST): $(SHA1TEST).o $(DLIBCRYPTO)
270 $(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
272 $(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO)
273 $(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
275 $(MDC2TEST): $(MDC2TEST).o $(DLIBCRYPTO)
276 $(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
278 $(MD4TEST): $(MD4TEST).o $(DLIBCRYPTO)
279 $(CC) -o $(MD4TEST) $(CFLAGS) $(MD4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
281 $(MD5TEST): $(MD5TEST).o $(DLIBCRYPTO)
282 $(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
284 $(HMACTEST): $(HMACTEST).o $(DLIBCRYPTO)
285 $(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
287 $(RC2TEST): $(RC2TEST).o $(DLIBCRYPTO)
288 $(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
290 $(BFTEST): $(BFTEST).o $(DLIBCRYPTO)
291 $(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
293 $(CASTTEST): $(CASTTEST).o $(DLIBCRYPTO)
294 $(CC) -o $(CASTTEST) $(CFLAGS) $(CASTTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
296 $(RC4TEST): $(RC4TEST).o $(DLIBCRYPTO)
297 $(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
299 $(RC5TEST): $(RC5TEST).o $(DLIBCRYPTO)
300 $(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
302 $(DESTEST): $(DESTEST).o $(DLIBCRYPTO)
303 $(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
305 $(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO)
306 $(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
308 $(DHTEST): $(DHTEST).o $(DLIBCRYPTO)
309 $(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
311 $(DSATEST): $(DSATEST).o $(DLIBCRYPTO)
312 $(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
314 $(METHTEST): $(METHTEST).o $(DLIBCRYPTO)
315 $(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
317 $(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
318 $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
320 # DO NOT DELETE THIS LINE -- make depend depends on it.
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/symhacks.h ../include/openssl/x509.h
341 bntest.o: ../include/openssl/x509_vfy.h
342 casttest.o: ../include/openssl/cast.h
343 destest.o: ../include/openssl/des.h ../include/openssl/e_os2.h
344 destest.o: ../include/openssl/opensslconf.h
345 dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h
346 dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
347 dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
348 dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
349 dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
350 dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h
351 dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
352 dsatest.o: ../include/openssl/dsa.h ../include/openssl/err.h
353 dsatest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
354 dsatest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
355 dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
356 dsatest.o: ../include/openssl/symhacks.h
357 exptest.o: ../include/openssl/bio.h ../include/openssl/bn.h
358 exptest.o: ../include/openssl/crypto.h ../include/openssl/err.h
359 exptest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
360 exptest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
361 exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
362 exptest.o: ../include/openssl/symhacks.h
363 hmactest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
364 hmactest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
365 hmactest.o: ../include/openssl/cast.h ../include/openssl/crypto.h
366 hmactest.o: ../include/openssl/des.h ../include/openssl/dh.h
367 hmactest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
368 hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
369 hmactest.o: ../include/openssl/idea.h ../include/openssl/md2.h
370 hmactest.o: ../include/openssl/md4.h ../include/openssl/md5.h
371 hmactest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
372 hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
373 hmactest.o: ../include/openssl/opensslv.h ../include/openssl/rc2.h
374 hmactest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
375 hmactest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
376 hmactest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
377 hmactest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
378 ideatest.o: ../include/openssl/idea.h ../include/openssl/opensslconf.h
379 md2test.o: ../include/openssl/md2.h ../include/openssl/opensslconf.h
380 md4test.o: ../include/openssl/md4.h
381 md5test.o: ../include/openssl/md5.h
382 mdc2test.o: ../include/openssl/des.h ../include/openssl/e_os2.h
383 mdc2test.o: ../include/openssl/mdc2.h ../include/openssl/opensslconf.h
384 randtest.o: ../include/openssl/rand.h
385 rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h
386 rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h
387 rc5test.o: ../include/openssl/rc5.h
388 rmdtest.o: ../include/openssl/ripemd.h
389 rsa_test.o: ../include/openssl/bio.h ../include/openssl/bn.h
390 rsa_test.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
391 rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h
392 rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
393 rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
394 rsa_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
395 rsa_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
396 sha1test.o: ../include/openssl/sha.h
397 shatest.o: ../include/openssl/sha.h
398 ssltest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
399 ssltest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
400 ssltest.o: ../include/openssl/buffer.h ../include/openssl/cast.h
401 ssltest.o: ../include/openssl/comp.h ../include/openssl/crypto.h
402 ssltest.o: ../include/openssl/des.h ../include/openssl/dh.h
403 ssltest.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
404 ssltest.o: ../include/openssl/e_os2.h ../include/openssl/err.h
405 ssltest.o: ../include/openssl/evp.h ../include/openssl/idea.h
406 ssltest.o: ../include/openssl/lhash.h ../include/openssl/md2.h
407 ssltest.o: ../include/openssl/md4.h ../include/openssl/md5.h
408 ssltest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
409 ssltest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
410 ssltest.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
411 ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
412 ssltest.o: ../include/openssl/rand.h ../include/openssl/rc2.h
413 ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
414 ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
415 ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
416 ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
417 ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
418 ssltest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
419 ssltest.o: ../include/openssl/tls1.h ../include/openssl/x509.h
420 ssltest.o: ../include/openssl/x509_vfy.h