]> granicus.if.org Git - curl/commitdiff
http_digest: Don't expose functions when HTTP and Crypto Auth are disabled
authorSteve Holme <steve_holme@hotmail.com>
Fri, 10 May 2019 12:10:34 +0000 (13:10 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 11 May 2019 16:23:32 +0000 (17:23 +0100)
Closes #3861

lib/easy.c
lib/http_digest.h
lib/url.c

index 39482469c39a779b16ba801b4e9f590521298cdc..40be38220a6a97af1b9ab6ca7c5f7ff5ab700749 100644 (file)
@@ -961,7 +961,10 @@ void curl_easy_reset(struct Curl_easy *data)
   /* zero out authentication data: */
   memset(&data->state.authhost, 0, sizeof(struct auth));
   memset(&data->state.authproxy, 0, sizeof(struct auth));
+
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
   Curl_digest_cleanup(data);
+#endif
 }
 
 /*
index fd225c7c1b3694e51a764adf40f3fe58fdfaf8d6..d3db16a334a4604a5a0b06200750fcf1f0158ff8 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -23,6 +23,8 @@
  ***************************************************************************/
 #include "curl_setup.h"
 
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
+
 /* this is for digest header input */
 CURLcode Curl_input_digest(struct connectdata *conn,
                            bool proxy, const char *header);
@@ -33,10 +35,8 @@ CURLcode Curl_output_digest(struct connectdata *conn,
                             const unsigned char *request,
                             const unsigned char *uripath);
 
-#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
 void Curl_digest_cleanup(struct Curl_easy *data);
-#else
-#define Curl_digest_cleanup(x) Curl_nop_stmt
-#endif
+
+#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_CRYPTO_AUTH */
 
 #endif /* HEADER_CURL_HTTP_DIGEST_H */
index cd775af4a59a7fa4a82406a3276d8e262c79e436..02198627eb86a699c6b1e4dd7543f5fbc35150b7 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -379,7 +379,9 @@ CURLcode Curl_close(struct Curl_easy *data)
   Curl_altsvc_cleanup(data->asi);
   data->asi = NULL;
 #endif
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
   Curl_digest_cleanup(data);
+#endif
   Curl_safefree(data->info.contenttype);
   Curl_safefree(data->info.wouldredirect);