From: Martin Willi Date: Fri, 19 Jun 2009 15:37:08 +0000 (+0200) Subject: build integrity_checker.c only if --enable-integrity-test set X-Git-Tag: 4.3.3~115 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=bef508755b0f35d849d3f77382ee02a2c6a0d265;hp=6a8c8815fe112059d7724f40687c377568b15ee3 build integrity_checker.c only if --enable-integrity-test set --- diff --git a/src/libstrongswan/Makefile.am b/src/libstrongswan/Makefile.am index d190f35..7f27b8b 100644 --- a/src/libstrongswan/Makefile.am +++ b/src/libstrongswan/Makefile.am @@ -7,7 +7,6 @@ debug.c debug.h \ enum.c enum.h \ settings.h settings.c \ printf_hook.c printf_hook.h \ -integrity_checker.c integrity_checker.h \ asn1/asn1.c asn1/asn1.h \ asn1/asn1_parser.c asn1/asn1_parser.h \ asn1/oid.c asn1/oid.h \ @@ -68,6 +67,12 @@ if USE_LOCK_PROFILER AM_CFLAGS += -DLOCK_PROFILER endif +if USE_INTEGRITY_TEST + AM_CFLAGS += -DINTEGRITY_TEST + libstrongswan_la_SOURCES += \ + integrity_checker.c integrity_checker.h +endif + if USE_VSTR libstrongswan_la_LIBADD += -lvstr endif diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c index 0116b8e..832c8b6 100644 --- a/src/libstrongswan/library.c +++ b/src/libstrongswan/library.c @@ -131,12 +131,17 @@ bool library_init(char *settings) if (lib->settings->get_bool(lib->settings, "libstrongswan.integrity_test", FALSE)) { +#ifdef INTEGRITY_TEST this->public.integrity = integrity_checker_create(CHECKSUM_LIBRARY); if (!lib->integrity->check(lib->integrity, "libstrongswan", library_init)) { DBG1("integrity check of libstrongswan failed"); return FALSE; } +#else /* !INTEGRITY_TEST */ + DBG1("integrity test enabled, but not supported"); + return FALSE; +#endif /* INTEGRITY_TEST */ } return TRUE; }