[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 16/282: cmake: Enable SMB for Windows builds
From: |
gnunet |
Subject: |
[gnurl] 16/282: cmake: Enable SMB for Windows builds |
Date: |
Wed, 01 Apr 2020 14:28:01 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit ea6d6205d9e13ce688afed28f6a09ade49b348d3
Author: Marc Aldorasi <address@hidden>
AuthorDate: Fri Dec 13 17:23:11 2019 -0500
cmake: Enable SMB for Windows builds
- Define USE_WIN32_CRYPTO by default. This enables SMB.
- Show whether SMB is enabled in the "Enabled features" output.
- Fix mingw compiler warning for call to CryptHashData by casting away
const param. mingw CryptHashData prototype is wrong.
Closes https://github.com/curl/curl/pull/4717
---
CMakeLists.txt | 23 ++++++++++++++++++-----
lib/curl_config.h.cmake | 3 +++
lib/md4.c | 2 +-
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb78921e1..3ef8d0e48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,6 +172,7 @@ if(HTTP_ONLY)
set(CURL_DISABLE_RTSP ON)
set(CURL_DISABLE_POP3 ON)
set(CURL_DISABLE_IMAP ON)
+ set(CURL_DISABLE_SMB ON)
set(CURL_DISABLE_SMTP ON)
set(CURL_DISABLE_GOPHER ON)
endif()
@@ -412,6 +413,10 @@ if(USE_NGHTTP2)
list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
endif()
+if(WIN32)
+ set(USE_WIN32_CRYPTO ON)
+endif()
+
if(NOT CURL_DISABLE_LDAP)
if(WIN32)
option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
@@ -1199,6 +1204,14 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()
+# NTLM support requires crypto function adaptions from various SSL libs
+# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS
+if(NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR USE_WINDOWS_SSPI OR
USE_DARWINSSL OR USE_MBEDTLS OR USE_WIN32_CRYPTO))
+ set(use_ntlm ON)
+else()
+ set(use_ntlm OFF)
+endif()
+
# Helper to populate a list (_items) with a label when conditions (the
remaining
# args) are satisfied
function(_add_if label)
@@ -1228,11 +1241,9 @@ _add_if("Kerberos" NOT CURL_DISABLE_CRYPTO_AUTH AND
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
# NTLM support requires crypto function adaptions from various SSL libs
# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS
-if(NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR USE_WINDOWS_SSPI OR
USE_SECTRANSP OR USE_MBEDTLS OR USE_NSS))
- _add_if("NTLM" 1)
- # TODO missing option (autoconf: --enable-ntlm-wb)
- _add_if("NTLM_WB" NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED)
-endif()
+_add_if("NTLM" use_ntlm)
+# TODO missing option (autoconf: --enable-ntlm-wb)
+_add_if("NTLM_WB" use_ntlm AND NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED)
# TODO missing option (--enable-tls-srp), depends on GNUTLS_SRP/OPENSSL_SRP
_add_if("TLS-SRP" USE_TLS_SRP)
# TODO option --with-nghttp2 tests for nghttp2 lib and nghttp2/nghttp2.h header
@@ -1261,6 +1272,8 @@ _add_if("POP3" NOT CURL_DISABLE_POP3)
_add_if("POP3S" NOT CURL_DISABLE_POP3 AND SSL_ENABLED)
_add_if("IMAP" NOT CURL_DISABLE_IMAP)
_add_if("IMAPS" NOT CURL_DISABLE_IMAP AND SSL_ENABLED)
+_add_if("SMB" NOT CURL_DISABLE_SMB AND use_ntlm)
+_add_if("SMBS" NOT CURL_DISABLE_SMB AND SSL_ENABLED AND use_ntlm)
_add_if("SMTP" NOT CURL_DISABLE_SMTP)
_add_if("SMTPS" NOT CURL_DISABLE_SMTP AND SSL_ENABLED)
_add_if("SCP" USE_LIBSSH2)
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index 2c3b6562d..1f6c3154f 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -73,6 +73,9 @@
#define CURL_EXTERN_SYMBOL
#endif
+/* Allow SMB to work on Windows */
+#cmakedefine USE_WIN32_CRYPTO
+
/* Use Windows LDAP implementation */
#cmakedefine USE_WIN32_LDAP 1
diff --git a/lib/md4.c b/lib/md4.c
index bbf897508..98de285ad 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -156,7 +156,7 @@ static void MD4_Init(MD4_CTX *ctx)
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
{
- CryptHashData(ctx->hHash, data, (unsigned int) size, 0);
+ CryptHashData(ctx->hHash, (BYTE *)data, (unsigned int) size, 0);
}
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 07/282: tool_dirhie.c: fix the copyright year range, (continued)
- [gnurl] 07/282: tool_dirhie.c: fix the copyright year range, gnunet, 2020/04/01
- [gnurl] 05/282: tool_dirhie: Allow directory traversal during creation, gnunet, 2020/04/01
- [gnurl] 04/282: KNOWN_BUGS: AUTH PLAIN for SMTP is not working on all servers, gnunet, 2020/04/01
- [gnurl] 01/282: RELEASE-PROCEDURE.md: fix next release date (Feb 26), gnunet, 2020/04/01
- [gnurl] 10/282: libtest/mk-lib1521: adapt to new public header layout, gnunet, 2020/04/01
- [gnurl] 06/282: bump: work towards 7.69.0 is started, gnunet, 2020/04/01
- [gnurl] 12/282: scripts/delta: adapt to new public header layout, gnunet, 2020/04/01
- [gnurl] 15/282: vtls: Refactor Curl_multissl_version to make the code clearer, gnunet, 2020/04/01
- [gnurl] 20/282: cmake: Improve libssh2 check on Windows, gnunet, 2020/04/01
- [gnurl] 17/282: multi: Change curl_multi_wait/poll to error on negative timeout, gnunet, 2020/04/01
- [gnurl] 16/282: cmake: Enable SMB for Windows builds,
gnunet <=
- [gnurl] 14/282: fix: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 18/282: ngtcp2: Add an error code for QUIC connection errors, gnunet, 2020/04/01
- [gnurl] 09/282: include: remove non-curl prefixed defines, gnunet, 2020/04/01
- [gnurl] 21/282: libssh2: add support for forcing a hostkey type, gnunet, 2020/04/01
- [gnurl] 22/282: misc: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 19/282: schannel: Make CURLOPT_CAINFO work better on Windows 7, gnunet, 2020/04/01
- [gnurl] 23/282: curl: remove 'config' field from OutStruct, gnunet, 2020/04/01
- [gnurl] 13/282: hostip: move code to resolve IP address literals to `Curl_resolv`, gnunet, 2020/04/01
- [gnurl] 11/282: test1167: verify global symbols in public headers are curl prefixed, gnunet, 2020/04/01
- [gnurl] 25/282: curl: make #0 not output the full URL, gnunet, 2020/04/01