build: fix build errors/warnings in rare configurations

- vtls: fix unused variable and symbols.
- ftp: fix unused variable.
- http: fix unused variables.
- smtp: fix unsued variable.
- wolfssl: fix unused variable with !proxy.
- libssh: fix unused argument.
- curl_trc: sync guards between declaration and definition.
- curl_trc: add missing guard for `Curl_trc_ssls` when !verbose.
- curl_trc: fix errors with !http + http3.
- curl_trc: fix missing function with !http + nghttp2.
- cf-h2-proxy: disable when !http + nghttp2, to avoid calling undeclared
  functions.
- sha256: fix missing declaration in rare configs.
- md4: fix symbol conflict when building GnuTLS together with AWS-LC or
  wolfSSL. By prioritizing the latter two. AWS-LC has no option
  to disable the clashing symbol. wolfSSL does, but the most seamless is
  to skip including GnuTLS's standalone `md4.h` to avoid the clash.
- build: fix errors with !http + nghttp2.
- build: catch !ssl + ssls-export combination in source. Convert
  build-level errors to warnings.
- build: fix errors with !http + http3.
- build: fix building curl tool and unit1302 in rare combinations.
  By always compiling base64 curlx functions.

- cmake: add `_CURL_SKIP_BUILD_CERTS` internal option.
  To disable automatically building certs with the testdeps target.
  To improve performance when testing builds.
  (used locally to find the failing builds fixed in this PR.)

Closes #17962
This commit is contained in:
Viktor Szakats 2025-07-18 18:17:06 +02:00
parent 871112d074
commit c37e06c642
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
29 changed files with 91 additions and 79 deletions

View file

@ -64,10 +64,8 @@
#endif
#endif /* USE_MBEDTLS */
#if defined(USE_GNUTLS)
#include <nettle/md4.h>
/* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
#elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
#if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
#include <wolfssl/openssl/md4.h>
#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
#include <openssl/md4.h>
@ -83,6 +81,8 @@
#include <CommonCrypto/CommonDigest.h>
#elif defined(USE_WIN32_CRYPTO)
#include <wincrypt.h>
#elif defined(USE_GNUTLS)
#include <nettle/md4.h>
#elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C))
#include <mbedtls/md4.h>
#endif
@ -93,27 +93,7 @@
#include "memdebug.h"
#if defined(USE_GNUTLS)
typedef struct md4_ctx MD4_CTX;
static int MD4_Init(MD4_CTX *ctx)
{
md4_init(ctx);
return 1;
}
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
{
md4_update(ctx, size, data);
}
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
{
md4_digest(ctx, MD4_DIGEST_SIZE, result);
}
#elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
#if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
#ifdef OPENSSL_COEXIST
#define MD4_CTX WOLFSSL_MD4_CTX
@ -193,6 +173,26 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
CryptReleaseContext(ctx->hCryptProv, 0);
}
#elif defined(USE_GNUTLS)
typedef struct md4_ctx MD4_CTX;
static int MD4_Init(MD4_CTX *ctx)
{
md4_init(ctx);
return 1;
}
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
{
md4_update(ctx, size, data);
}
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
{
md4_digest(ctx, MD4_DIGEST_SIZE, result);
}
#elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C))
struct md4_ctx {