diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2021-03-06 15:52:09 +0100 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2021-03-15 17:01:30 +0100 |
commit | cc615f48e712202fc26297bc7597e3a1e9188aac (patch) | |
tree | 68414bd77b161ba574aa2c2a34acc6991fc10813 /configure.ac | |
parent | 71529574215190baa15e49e0f825aed79e6566d4 (diff) | |
download | curl-cc615f48e712202fc26297bc7597e3a1e9188aac.tar.gz |
config: fix building SMB with configure using Win32 Crypto
Align conditions for NTLM features between CMake and configure
builds by differentiating between USE_NTLM and USE_CURL_NTLM_CORE,
just like curl_setup.h does internally to detect support of:
- USE_NTLM: required for NTLM crypto authentication feature
- USE_CURL_NTLM_CORE: required for SMB protocol
Implement USE_WIN32_CRYPTO detection by checking for Crypt functions
in wincrypt.h which are not available in the Windows App environment.
Link advapi32 and crypt32 for Crypto API and Schannel SSL backend.
Fix condition of Schannel SSL backend in CMake build accordingly.
Reviewed-by: Marcel Raad
Closes #6277
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index a16804419..42e6838df 100755 --- a/configure.ac +++ b/configure.ac @@ -357,6 +357,7 @@ case X-"$curl_cv_native_windows" in CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP + CURL_CHECK_HEADER_WINCRYPT CURL_CHECK_HEADER_WINLDAP CURL_CHECK_HEADER_WINBER ;; @@ -364,11 +365,13 @@ case X-"$curl_cv_native_windows" in curl_cv_header_winsock_h="no" curl_cv_header_winsock2_h="no" curl_cv_header_ws2tcpip_h="no" + curl_cv_header_wincrypt_h="no" curl_cv_header_winldap_h="no" curl_cv_header_winber_h="no" ;; esac CURL_CHECK_WIN32_LARGEFILE +CURL_CHECK_WIN32_CRYPTO CURL_MAC_CFLAGS CURL_SUPPORTS_BUILTIN_AVAILABLE @@ -1648,7 +1651,6 @@ if test -z "$ssl_backends" -o "x$OPT_SCHANNEL" != xno; then AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) AC_SUBST(USE_WINDOWS_SSPI, [1]) curl_sspi_msg="enabled" - LIBS="-lcrypt32 $LIBS" else AC_MSG_RESULT(no) fi @@ -1657,6 +1659,11 @@ else AC_MSG_RESULT(no) fi +dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL +if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then + LIBS="-ladvapi32 -lcrypt32 $LIBS" +fi + OPT_SECURETRANSPORT=no AC_ARG_WITH(darwinssl,dnl AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS]) @@ -5222,17 +5229,23 @@ if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then - if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \ - -o "x$WOLFSSL_NTLM" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" +if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ + \( "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \ + -o "x$SECURETRANSPORT_ENABLED" = "x1" \ + -o "x$USE_WIN32_CRYPTO" = "x1" \ + -o "x$WOLFSSL_NTLM" = "x1" \); then + use_curl_ntlm_core=yes +else + use_curl_ntlm_core=no +fi +if test "x$use_curl_ntlm_core" = "xyes" \ + -o "x$USE_WINDOWS_SSPI" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" - if test "x$CURL_DISABLE_HTTP" != "x1" -a \ - "x$NTLM_WB_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" - fi + if test "x$CURL_DISABLE_HTTP" != "x1" -a \ + "x$NTLM_WB_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" fi fi @@ -5333,11 +5346,7 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then fi fi if test "x$CURL_DISABLE_SMB" != "x1" \ - -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \ - -a \( "x$OPENSSL_ENABLED" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \ - -o "x$WOLFSSL_NTLM" = "x1" \); then + -a "x$use_curl_ntlm_core" = "xyes"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" |