Makefile.ssl 9.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#
# test/Makefile.ssl
#

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

PEX_LIBS=
16
EX_LIBS= #-lnsl -lsocket
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

CFLAGS= $(INCLUDES) $(CFLAG)

GENERAL=Makefile.ssl

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

BNTEST=		bntest
EXPTEST=	exptest
IDEATEST=	ideatest
SHATEST=	shatest
SHA1TEST=	sha1test
MDC2TEST=	mdc2test
33
RMDTEST=	rmdtest
34 35
MD2TEST=	md2test
MD5TEST=	md5test
36
HMACTEST=	hmactest
37
RC2TEST=	rc2test
38 39
RC4TEST=	rc4test
RC5TEST=	rc5test
40
BFTEST=		bftest
41
CASTTEST=	casttest
42 43 44 45 46 47 48
DESTEST=	destest
RANDTEST=	randtest
DHTEST=		dhtest
DSATEST=	dsatest
METHTEST=	methtest
SSLTEST=	ssltest

49 50 51 52 53
EXE=	$(BNTEST) $(IDEATEST) $(MD2TEST)  $(MD5TEST) $(HMACTEST) \
	$(RC2TEST) $(RC4TEST) $(RC5TEST) \
	$(DESTEST) $(SHATEST) $(SHA1TEST) $(MDC2TEST) $(RMDTEST) \
	$(RANDTEST) $(DHTEST) \
	$(BFTEST) $(CASTTEST) $(SSLTEST) $(EXPTEST) $(DSATEST)
54 55 56

# $(METHTEST)

57 58 59 60 61 62 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 \
	$(BFTEST).o  $(SSLTEST).o  $(DSATEST).o  $(EXPTEST).o
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 \
	$(BFTEST).c  $(SSLTEST).c $(DSATEST).c   $(EXPTEST).c
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94

EXHEADER= 
HEADER=	$(EXHEADER)

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

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

all:	exe

exe:	$(EXE)

files:
	perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

links:
	/bin/rm -f Makefile
	$(TOP)/util/point.sh Makefile.ssl Makefile ;

errors:

install:

tags:
	ctags $(SRC)

tests:	exe apps \
95 96
	test_des test_idea test_sha test_md5 test_hmac test_md2 test_mdc2 \
	test_rc2 test_rc4 test_rc5 test_bf test_cast \
B
Ben Laurie 已提交
97 98
	test_rand test_enc test_x509 test_rsa test_crl test_sid test_reqgen \
	test_req test_pkcs7 test_bn test_verify test_dh test_dsa \
99 100 101 102 103 104
	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:
105
	./$(DESTEST)
106 107 108 109 110 111 112 113 114 115 116 117 118 119

test_idea:
	./$(IDEATEST)

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

test_mdc2:
	./$(MDC2TEST)

test_md5:
	./$(MD5TEST)

120 121 122
test_hmac:
	./$(HMACTEST)

123 124 125
test_md2:
	./$(MD2TEST)

126 127
test_rmd:
	./$(RMDTEST)
128 129 130 131

test_bf:
	./$(BFTEST)

132 133 134 135 136 137
test_cast:
	./$(CASTTEST)

test_rc2:
	./$(RC2TEST)

138 139 140
test_rc4:
	./$(RC4TEST)

141 142 143
test_rc5:
	./$(RC5TEST)

144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
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

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 'test a^b%c implementations'
	./$(EXPTEST)
	@echo starting big number library test, could take a while...
	@(./$(BNTEST)|bc) | awk '{ \
if ($$0 != "0") {print "error"; exit(1); } \
if (((NR+1)%64) == 0) print NR+1," tests done"; }'

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 已提交
186
	../apps/openssl verify -CApath ../certs ../certs/*.pem
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248

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

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

test_reqgen:
	@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:
	$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(SRC)

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

clean:
	/bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log

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

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

$(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)

249 250 251
$(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO)
	$(CC) -o $(RMDTEST) $(CFLAGS) $(RMDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

252 253 254 255 256 257
$(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)

258 259 260
$(HMACTEST): $(HMACTEST).o $(DLIBCRYPTO)
	$(CC) -o $(HMACTEST) $(CFLAGS) $(HMACTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

261 262 263 264 265 266
$(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)

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

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

273 274 275
$(RC5TEST): $(RC5TEST).o $(DLIBCRYPTO)
	$(CC) -o $(RC5TEST) $(CFLAGS) $(RC5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)

276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
$(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.
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333

bftest.o: ../include/blowfish.h ../include/asn1.h ../include/bio.h
bntest.o: ../include/blowfish.h ../include/bn.h ../include/cast.h
bntest.o: ../include/crypto.h ../include/des.h ../include/dh.h ../include/dsa.h
bntest.o: ../include/e_os.h ../include/err.h ../include/evp.h ../include/idea.h
bntest.o: ../include/md2.h ../include/md5.h ../include/mdc2.h
bntest.o: ../include/objects.h ../include/pkcs7.h ../include/rand.h
bntest.o: ../include/rc2.h ../include/rc4.h ../include/rc5.h
bntest.o: ../include/ripemd.h ../include/rsa.h ../include/sha.h
bntest.o: ../include/stack.h ../include/x509.h ../include/x509_vfy.h
casttest.o: ../include/cast.h ../include/des.h ../include/bio.h ../include/bn.h
dhtest.o: ../include/crypto.h ../include/dh.h ../include/stack.h
dsatest.o: ../include/bio.h ../include/bn.h ../include/crypto.h
dsatest.o: ../include/dsa.h ../include/err.h ../include/rand.h
dsatest.o: ../include/stack.h ../include/bio.h ../include/bn.h
exptest.o: ../include/crypto.h ../include/err.h ../include/rand.h
exptest.o: ../include/stack.h ../include/asn1.h ../include/bio.h
hmactest.o: ../include/blowfish.h ../include/bn.h ../include/cast.h
hmactest.o: ../include/crypto.h ../include/des.h ../include/dh.h
hmactest.o: ../include/dsa.h ../include/evp.h ../include/hmac.h
hmactest.o: ../include/idea.h ../include/md2.h ../include/md5.h
hmactest.o: ../include/mdc2.h ../include/objects.h ../include/rc2.h
hmactest.o: ../include/rc4.h ../include/rc5.h ../include/ripemd.h
hmactest.o: ../include/rsa.h ../include/sha.h ../include/stack.h
ideatest.o: ../include/idea.h ../include/md2.h ../include/md5.h
mdc2test.o: ../include/des.h ../include/mdc2.h ../include/rand.h
rc2test.o: ../include/rc2.h ../include/rc4.h ../include/rc5.h
rmdtest.o: ../include/ripemd.h ../include/sha.h ../include/sha.h
ssltest.o: ../include/asn1.h ../include/bio.h ../include/blowfish.h
ssltest.o: ../include/bn.h ../include/buffer.h ../include/cast.h
ssltest.o: ../include/crypto.h ../include/des.h ../include/dh.h
ssltest.o: ../include/dsa.h ../include/e_os.h ../include/err.h ../include/evp.h
ssltest.o: ../include/idea.h ../include/lhash.h ../include/md2.h
ssltest.o: ../include/md5.h ../include/mdc2.h ../include/objects.h
ssltest.o: ../include/pkcs7.h ../include/rc2.h ../include/rc4.h
ssltest.o: ../include/rc5.h ../include/ripemd.h ../include/rsa.h
ssltest.o: ../include/sha.h ../include/ssl.h ../include/ssl2.h
ssltest.o: ../include/ssl23.h ../include/ssl3.h ../include/stack.h
ssltest.o: ../include/tls1.h ../include/x509.h ../include/x509_vfy.h