From 96567fc8a22f298076c73a5167f4edc126d44c21 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 13 Mar 2007 14:52:18 +0000 Subject: [PATCH] fixed compilation warnings and errors when not using curl --- src/libstrongswan/Makefile.am | 4 ++++ src/libstrongswan/crypto/ca.c | 1 - src/libstrongswan/crypto/ocsp.c | 1 - src/libstrongswan/utils/fetcher.c | 2 ++ src/libstrongswan/utils/leak_detective.c | 5 ++++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libstrongswan/Makefile.am b/src/libstrongswan/Makefile.am index 3c1a913c6..0236ba375 100644 --- a/src/libstrongswan/Makefile.am +++ b/src/libstrongswan/Makefile.am @@ -54,6 +54,10 @@ if USE_LEAK_DETECTIVE AM_CFLAGS = -DLEAK_DETECTIVE endif +if USE_LIBCURL + libstrongswan_la_LIBADD += -lcurl +endif + asn1/oid.c : asn1/oid.txt asn1/oid.pl cd asn1 && $(PERL) oid.pl diff --git a/src/libstrongswan/crypto/ca.c b/src/libstrongswan/crypto/ca.c index e9ccbfd5e..1e930a466 100644 --- a/src/libstrongswan/crypto/ca.c +++ b/src/libstrongswan/crypto/ca.c @@ -456,7 +456,6 @@ static int print(FILE *stream, const struct printf_info *info, bool utc = TRUE; int written = 0; const x509_t *cacert; - chunk_t keyid; if (info->alt) { diff --git a/src/libstrongswan/crypto/ocsp.c b/src/libstrongswan/crypto/ocsp.c index 6f21aa8dc..cc4910e43 100644 --- a/src/libstrongswan/crypto/ocsp.c +++ b/src/libstrongswan/crypto/ocsp.c @@ -467,7 +467,6 @@ static bool ocsp_parse_basic_response(chunk_t blob, int level0, response_t *res) { u_int level, version; u_int extn_oid = OID_UNKNOWN; - u_char buf[BUF_LEN]; asn1_ctx_t ctx; bool critical; chunk_t object; diff --git a/src/libstrongswan/utils/fetcher.c b/src/libstrongswan/utils/fetcher.c index b14ba1691..30154f8e1 100644 --- a/src/libstrongswan/utils/fetcher.c +++ b/src/libstrongswan/utils/fetcher.c @@ -137,7 +137,9 @@ static chunk_t post(private_fetcher_t *this, const char *request_type, chunk_t r */ static void destroy(private_fetcher_t *this) { +#ifdef LIBCURL curl_easy_cleanup(this->curl); +#endif /* LIBCURL */ free(this); } diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 3f564b0e2..b8a023270 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -176,8 +176,9 @@ struct whitelist_t { }; #ifdef LIBCURL +/* dummy declaration for whitelisting */ void *Curl_getaddrinfo(void); -#endif +#endif /* LIBCURL */ whitelist_t whitelist[] = { {pthread_create, 2542}, @@ -191,8 +192,10 @@ whitelist_t whitelist[] = { {register_printf_function, 159}, {syslog, 45}, {dlopen, 109}, +# ifdef LIBCURL /* from /usr/lib/libcurl.so.3 */ {Curl_getaddrinfo, 480}, +# endif /* LIBCURL */ }; /**