Makefile.ssl 12.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
#
# test/Makefile.ssl
#

DIR=		test
TOP=		..
CC=		cc
INCLUDES=	-I../include
CFLAG=		-g
10 11
INSTALL_PREFIX=
OPENSSLDIR=     /usr/local/ssl
12 13 14
INSTALLTOP=	/usr/local/ssl
MAKEFILE=	Makefile.ssl
MAKE=		make -f $(MAKEFILE)
15
MAKEDEPEND=	$(TOP)/util/domd $(TOP)
16 17

PEX_LIBS=
18
EX_LIBS= #-lnsl -lsocket
19 20 21

CFLAGS= $(INCLUDES) $(CFLAG)

U
Ulf Möller 已提交
22 23 24 25
GENERAL=Makefile.ssl maketests.com \
	tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \
	tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \
	testca.com VMSca-response.1 VMSca-response.2
26 27 28 29 30 31 32 33 34 35 36 37

DLIBCRYPTO= ../libcrypto.a
DLIBSSL= ../libssl.a
LIBCRYPTO= -L.. -lcrypto
LIBSSL= -L.. -lssl

BNTEST=		bntest
EXPTEST=	exptest
IDEATEST=	ideatest
SHATEST=	shatest
SHA1TEST=	sha1test
MDC2TEST=	mdc2test
38
RMDTEST=	rmdtest
39 40
MD2TEST=	md2test
MD5TEST=	md5test
41
HMACTEST=	hmactest
42
RC2TEST=	rc2test
43 44
RC4TEST=	rc4test
RC5TEST=	rc5test
45
BFTEST=		bftest
46
CASTTEST=	casttest
47 48 49 50 51 52
DESTEST=	destest
RANDTEST=	randtest
DHTEST=		dhtest
DSATEST=	dsatest
METHTEST=	methtest
SSLTEST=	ssltest
B
Ben Laurie 已提交
53
RSATEST=	rsa_oaep_test
54

55 56 57 58
EXE=	$(BNTEST) $(IDEATEST) $(MD2TEST)  $(MD5TEST) $(HMACTEST) \
	$(RC2TEST) $(RC4TEST) $(RC5TEST) \
	$(DESTEST) $(SHATEST) $(SHA1TEST) $(MDC2TEST) $(RMDTEST) \
	$(RANDTEST) $(DHTEST) \
B
Ben Laurie 已提交
59
	$(BFTEST) $(CASTTEST) $(SSLTEST) $(EXPTEST) $(DSATEST) $(RSATEST)
60 61 62

# $(METHTEST)

63 64 65 66
OBJ=	$(BNTEST).o $(IDEATEST).o $(MD2TEST).o  $(MD5TEST).o $(HMACTEST).o \
	$(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \
	$(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(MDC2TEST).o $(RMDTEST).o \
	$(RANDTEST).o $(DHTEST).o $(CASTTEST).o \
B
Ben Laurie 已提交
67
	$(BFTEST).o  $(SSLTEST).o  $(DSATEST).o  $(EXPTEST).o $(RSATEST).o
68 69 70 71
SRC=	$(BNTEST).c $(IDEATEST).c $(MD2TEST).c  $(MD5TEST).c  $(HMACTEST).c \
	$(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \
	$(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
	$(RANDTEST).c $(DHTEST).c $(CASTTEST).c \
B
Ben Laurie 已提交
72
	$(BFTEST).c  $(SSLTEST).c $(DSATEST).c   $(EXPTEST).c $(RSATEST).c
73 74 75 76 77 78 79 80 81 82 83 84 85 86

EXHEADER= 
HEADER=	$(EXHEADER)

ALL=    $(GENERAL) $(SRC) $(HEADER)

top:
	(cd ..; $(MAKE) DIRS=$(DIR) all)

all:	exe

exe:	$(EXE)

files:
87
	$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
88 89

links:
90
	@@$(TOP)/util/point.sh Makefile.ssl Makefile
91 92 93 94 95 96 97 98 99

errors:

install:

tags:
	ctags $(SRC)

tests:	exe apps \
100
	test_des test_idea test_sha test_md5 test_hmac test_md2 test_mdc2 \
A
Andy Polyakov 已提交
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 105 106 107 108 109
	test_ss test_ssl test_ca

apps:
	@(cd ../apps; $(MAKE)  CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all)

test_des:
110
	./$(DESTEST)
111 112 113 114 115 116 117 118 119 120 121 122 123 124

test_idea:
	./$(IDEATEST)

test_sha:
	./$(SHATEST)
	./$(SHA1TEST)

test_mdc2:
	./$(MDC2TEST)

test_md5:
	./$(MD5TEST)

125 126 127
test_hmac:
	./$(HMACTEST)

128 129 130
test_md2:
	./$(MD2TEST)

131 132
test_rmd:
	./$(RMDTEST)
133 134 135 136

test_bf:
	./$(BFTEST)

137 138 139 140 141 142
test_cast:
	./$(CASTTEST)

test_rc2:
	./$(RC2TEST)

143 144 145
test_rc4:
	./$(RC4TEST)

146 147 148
test_rc5:
	./$(RC5TEST)

149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
test_rand:
	./$(RANDTEST)

test_enc:
	@sh ./testenc

test_x509:
	echo test normal x509v1 certificate
	sh ./tx509 2>/dev/null
	echo test first x509v3 certificate
	sh ./tx509 v3-cert1.pem 2>/dev/null
	echo test second x509v3 certificate
	sh ./tx509 v3-cert2.pem 2>/dev/null

test_rsa:
	@sh ./trsa 2>/dev/null
B
Ben Laurie 已提交
165
	./$(RSATEST)
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182

test_crl:
	@sh ./tcrl 2>/dev/null

test_sid:
	@sh ./tsid 2>/dev/null

test_req:
	@sh ./treq 2>/dev/null
	@sh ./treq testreq2.pem 2>/dev/null

test_pkcs7:
	@sh ./tpkcs7 2>/dev/null
	@sh ./tpkcs7d 2>/dev/null

test_bn:
	@echo starting big number library test, could take a while...
183 184 185 186 187 188
# This *should* work:
#	@(./$(BNTEST)|bc) | awk '{ \
# Some broken bc's treat the pipe as a terminal :-(
# By using a temporary file, errors detected by awk may be farther away from
# the test that caused them; but even with the pipe there'd be some distance.
	@(./$(BNTEST) >tmp.bntest; echo quit >>tmp.bntest; bc tmp.bntest) | awk '{ \
189 190
if ($$0 != "0") {print "error"; exit(1); } \
if (((NR+1)%64) == 0) print NR+1," tests done"; }'
191 192
	@echo 'test a^b%c implementations'
	./$(EXPTEST)
193 194 195 196

test_verify:
	@echo "The following command should have some OK's and some failures"
	@echo "There are definitly a few expired certificates"
B
Ben Laurie 已提交
197
	../apps/openssl verify -CApath ../certs ../certs/*.pem
198 199 200 201 202 203 204 205 206

test_dh:
	@echo "Generate as set of DH parameters"
	./$(DHTEST)

test_dsa:
	@echo "Generate as set of DSA parameters"
	./$(DSATEST)

207
test_gen:
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
	@echo "Generate and verify a certificate request"
	@sh ./testgen

test_ss:
	@echo "Generate and certify a test certificate"
	@sh ./testss

test_ssl:
	@echo "test SSL protocol"
	@sh ./testssl

test_ca:
	@echo "Generate and certify a test certificate via the 'ca' program"
	@sh ./testca

lint:
	lint -DLINT $(INCLUDES) $(SRC)>fluff

depend:
B
Bodo Möller 已提交
227
	$(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(SRC)
228 229

dclean:
230
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
231 232 233
	mv -f Makefile.new $(MAKEFILE)

clean:
234
	rm -f .rnd tmp.bntest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log
235 236 237 238 239 240 241

$(DLIBSSL):
	(cd ../ssl; $(MAKE))

$(DLIBCRYPTO):
	(cd ../crypto; $(MAKE))

B
Ben Laurie 已提交
242 243 244
$(RSATEST): $(RSATEST).o $(DLIBCRYPTO)
	$(CC) -o $(RSATEST) $(CFLAGS) $(RSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
$(BNTEST): $(BNTEST).o $(DLIBCRYPTO)
	$(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(EXPTEST): $(EXPTEST).o $(DLIBCRYPTO)
	$(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(IDEATEST): $(IDEATEST).o $(DLIBCRYPTO)
	$(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(MD2TEST): $(MD2TEST).o $(DLIBCRYPTO)
	$(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(SHATEST): $(SHATEST).o $(DLIBCRYPTO)
	$(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(SHA1TEST): $(SHA1TEST).o $(DLIBCRYPTO)
	$(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

263 264 265
$(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO)
	$(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

266 267 268 269 270 271
$(MDC2TEST): $(MDC2TEST).o $(DLIBCRYPTO)
	$(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(MD5TEST): $(MD5TEST).o $(DLIBCRYPTO)
	$(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

272 273 274
$(HMACTEST): $(HMACTEST).o $(DLIBCRYPTO)
	$(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

275 276 277 278 279 280
$(RC2TEST): $(RC2TEST).o $(DLIBCRYPTO)
	$(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(BFTEST): $(BFTEST).o $(DLIBCRYPTO)
	$(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

281 282
$(CASTTEST): $(CASTTEST).o $(DLIBCRYPTO)
	$(CC) -o $(CASTTEST) $(CFLAGS) $(CASTTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
283 284 285 286

$(RC4TEST): $(RC4TEST).o $(DLIBCRYPTO)
	$(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

287 288 289
$(RC5TEST): $(RC5TEST).o $(DLIBCRYPTO)
	$(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
$(DESTEST): $(DESTEST).o $(DLIBCRYPTO)
	$(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO)
	$(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(DHTEST): $(DHTEST).o $(DLIBCRYPTO)
	$(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(DSATEST): $(DSATEST).o $(DLIBCRYPTO)
	$(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(METHTEST): $(METHTEST).o $(DLIBCRYPTO)
	$(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

$(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
	$(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)

# DO NOT DELETE THIS LINE -- make depend depends on it.
B
Ben Laurie 已提交
309

B
Bodo Möller 已提交
310
bftest.o: ../include/openssl/blowfish.h
311
bntest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
B
Bodo Möller 已提交
312 313 314
bntest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
bntest.o: ../include/openssl/cast.h ../include/openssl/crypto.h
bntest.o: ../include/openssl/des.h ../include/openssl/dh.h
315 316 317 318 319 320 321 322 323 324 325 326
bntest.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
bntest.o: ../include/openssl/e_os2.h ../include/openssl/err.h
bntest.o: ../include/openssl/evp.h ../include/openssl/idea.h
bntest.o: ../include/openssl/md2.h ../include/openssl/md5.h
bntest.o: ../include/openssl/mdc2.h ../include/openssl/objects.h
bntest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
bntest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
bntest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
bntest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
bntest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
bntest.o: ../include/openssl/sha.h ../include/openssl/stack.h
bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
B
Bodo Möller 已提交
327
casttest.o: ../include/openssl/cast.h
B
Bodo Möller 已提交
328
destest.o: ../include/openssl/des.h ../include/openssl/e_os2.h
B
Ben Laurie 已提交
329
destest.o: ../include/openssl/opensslconf.h
B
Bodo Möller 已提交
330 331 332 333 334
dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h
dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dhtest.o: ../include/openssl/stack.h
dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h
335 336 337 338
dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
dsatest.o: ../include/openssl/dsa.h ../include/openssl/err.h
dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dsatest.o: ../include/openssl/rand.h ../include/openssl/stack.h
B
Bodo Möller 已提交
339 340 341 342 343 344 345 346
exptest.o: ../include/openssl/bio.h ../include/openssl/bn.h
exptest.o: ../include/openssl/crypto.h ../include/openssl/err.h
exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
exptest.o: ../include/openssl/rand.h ../include/openssl/stack.h
hmactest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
hmactest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
hmactest.o: ../include/openssl/cast.h ../include/openssl/crypto.h
hmactest.o: ../include/openssl/des.h ../include/openssl/dh.h
B
Bodo Möller 已提交
347
hmactest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
B
Ben Laurie 已提交
348 349 350 351 352 353 354 355 356
hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
hmactest.o: ../include/openssl/idea.h ../include/openssl/md2.h
hmactest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
hmactest.o: ../include/openssl/opensslv.h ../include/openssl/rc2.h
hmactest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
hmactest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
hmactest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
hmactest.o: ../include/openssl/stack.h
B
Bodo Möller 已提交
357 358 359
ideatest.o: ../include/openssl/idea.h ../include/openssl/opensslconf.h
md2test.o: ../include/openssl/md2.h ../include/openssl/opensslconf.h
md5test.o: ../include/openssl/md5.h
B
Bodo Möller 已提交
360
mdc2test.o: ../include/openssl/des.h ../include/openssl/e_os2.h
B
Ben Laurie 已提交
361
mdc2test.o: ../include/openssl/mdc2.h ../include/openssl/opensslconf.h
B
Bodo Möller 已提交
362 363 364 365 366
randtest.o: ../include/openssl/rand.h
rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h
rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h
rc5test.o: ../include/openssl/rc5.h
rmdtest.o: ../include/openssl/ripemd.h
367 368 369
rsa_oaep_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
rsa_oaep_test.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
rsa_oaep_test.o: ../include/openssl/err.h ../include/openssl/opensslconf.h
370 371
rsa_oaep_test.o: ../include/openssl/opensslv.h ../include/openssl/rand.h
rsa_oaep_test.o: ../include/openssl/rsa.h ../include/openssl/stack.h
B
Bodo Möller 已提交
372 373
sha1test.o: ../include/openssl/sha.h
shatest.o: ../include/openssl/sha.h
374
ssltest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
B
Bodo Möller 已提交
375 376 377 378
ssltest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
ssltest.o: ../include/openssl/buffer.h ../include/openssl/cast.h
ssltest.o: ../include/openssl/crypto.h ../include/openssl/des.h
ssltest.o: ../include/openssl/dh.h ../include/openssl/dsa.h
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
ssltest.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
ssltest.o: ../include/openssl/err.h ../include/openssl/evp.h
ssltest.o: ../include/openssl/idea.h ../include/openssl/lhash.h
ssltest.o: ../include/openssl/md2.h ../include/openssl/md5.h
ssltest.o: ../include/openssl/mdc2.h ../include/openssl/objects.h
ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
ssltest.o: ../include/openssl/pem.h ../include/openssl/pem2.h
ssltest.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
ssltest.o: ../include/openssl/stack.h ../include/openssl/tls1.h
ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h