提交 6017a551 编写于 作者: M Mike Bland 提交者: Matt Caswell

Use testutil registry in heartbeat_test

Reviewed-by: NTim Hudson <tjh@openssl.org>
上级 5e3de8e6
...@@ -429,33 +429,24 @@ static int test_tls1_heartbleed_empty_payload() ...@@ -429,33 +429,24 @@ static int test_tls1_heartbleed_empty_payload()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int num_failed; int result = 0;
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
num_failed = test_dtls1_not_bleeding() + ADD_TEST(test_dtls1_not_bleeding);
test_dtls1_not_bleeding_empty_payload() + ADD_TEST(test_dtls1_not_bleeding_empty_payload);
test_dtls1_heartbleed() + ADD_TEST(test_dtls1_heartbleed);
test_dtls1_heartbleed_empty_payload() + ADD_TEST(test_dtls1_heartbleed_empty_payload);
/* The following test causes an assertion failure at ADD_TEST(test_dtls1_heartbleed_excessive_plaintext_length);
* ssl/d1_pkt.c:dtls1_write_bytes() in versions prior to 1.0.1g: */ ADD_TEST(test_tls1_not_bleeding);
(OPENSSL_VERSION_NUMBER >= 0x1000107fL ? ADD_TEST(test_tls1_not_bleeding_empty_payload);
test_dtls1_heartbleed_excessive_plaintext_length() : 0) + ADD_TEST(test_tls1_heartbleed);
test_tls1_not_bleeding() + ADD_TEST(test_tls1_heartbleed_empty_payload);
test_tls1_not_bleeding_empty_payload() +
test_tls1_heartbleed() + result = run_tests(argv[0]);
test_tls1_heartbleed_empty_payload() +
0;
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
return result;
if (num_failed != 0)
{
printf("%d test%s failed\n", num_failed, num_failed != 1 ? "s" : "");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
} }
#else /* OPENSSL_NO_HEARTBEATS*/ #else /* OPENSSL_NO_HEARTBEATS*/
......
...@@ -129,7 +129,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ ...@@ -129,7 +129,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \
$(FIPS_TEST_SUITE).o $(FIPS_DHVS).o $(FIPS_ECDSAVS).o \ $(FIPS_TEST_SUITE).o $(FIPS_DHVS).o $(FIPS_ECDSAVS).o \
$(FIPS_ECDHVS).o $(FIPS_CMACTEST).o $(FIPS_ALGVS).o \ $(FIPS_ECDHVS).o $(FIPS_CMACTEST).o $(FIPS_ALGVS).o \
$(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(V3NAMETEST).o \ $(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(V3NAMETEST).o \
$(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o $(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o \
testutil.o
SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \
...@@ -145,7 +146,8 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ ...@@ -145,7 +146,8 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(FIPS_TEST_SUITE).c $(FIPS_DHVS).c $(FIPS_ECDSAVS).c \ $(FIPS_TEST_SUITE).c $(FIPS_DHVS).c $(FIPS_ECDSAVS).c \
$(FIPS_ECDHVS).c $(FIPS_CMACTEST).c $(FIPS_ALGVS).c \ $(FIPS_ECDHVS).c $(FIPS_CMACTEST).c $(FIPS_ALGVS).c \
$(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(V3NAMETEST).c \ $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(V3NAMETEST).c \
$(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c $(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c \
testutil.c
EXHEADER= EXHEADER=
HEADER= $(EXHEADER) HEADER= $(EXHEADER)
...@@ -416,14 +418,14 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ ...@@ -416,14 +418,14 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
fi; \ fi; \
LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \ $(MAKE) -f $(TOP)/Makefile.shared -e \
APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target} link_app.$${shlib_target}
BUILD_CMD_STATIC=shlib_target=; \ BUILD_CMD_STATIC=shlib_target=; \
LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO) $(LIBKRB5)"; \ LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \ $(MAKE) -f $(TOP)/Makefile.shared -e \
APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target} link_app.$${shlib_target}
...@@ -624,8 +626,8 @@ $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO) ...@@ -624,8 +626,8 @@ $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
$(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO) $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
@target=$(V3NAMETEST); $(BUILD_CMD) @target=$(V3NAMETEST); $(BUILD_CMD)
$(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) testutil.o
@target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC) @target=$(HEARTBEATTEST) testutil=testutil.o; $(BUILD_CMD_STATIC)
#$(AESTEST).o: $(AESTEST).c #$(AESTEST).o: $(AESTEST).c
# $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册