]> granicus.if.org Git - curl/commitdiff
metalink: allow compiling with multiple SSL backends
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 18 Aug 2017 05:53:33 +0000 (07:53 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 28 Aug 2017 12:56:59 +0000 (14:56 +0200)
Previously, the code assumed that at most one of the SSL backends would
be compiled in, emulating OpenSSL's functions if the configured backend
was not OpenSSL itself.

However, now we allow building with multiple SSL backends and choosing
one at runtime. Therefore, metalink needs to be adjusted to handle this
scenario, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
src/tool_metalink.c

index 4713a911b8fda0c1bb74cacff2cf269f34c9af24..a20aec14eb4547ea623e1ef26a4a2e5d2577ab43 100644 (file)
@@ -117,7 +117,9 @@ struct win32_crypto_hash {
     return PARAM_NO_MEM; \
 } WHILE_FALSE
 
-#ifdef USE_GNUTLS_NETTLE
+#if defined(USE_OPENSSL)
+/* Functions are already defined */
+#elif defined(USE_GNUTLS_NETTLE)
 
 static int MD5_Init(MD5_CTX *ctx)
 {
@@ -375,7 +377,7 @@ static void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx)
   sha256_finish(ctx, digest);
 }
 
-#elif defined(_WIN32) && !defined(USE_OPENSSL)
+#elif defined(_WIN32)
 
 static void win32_crypto_final(struct win32_crypto_hash *ctx,
                                unsigned char *digest,