New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: fix building SMB with configure using Win32 Crypto #6277
Conversation
At the moment configure is not aware of Lines 5030 to 5042 in 753a2c7
Lines 5130 to 5140 in 753a2c7
vs: Lines 507 to 509 in 753a2c7
Lines 1333 to 1339 in 753a2c7
I would like to suggest to either make |
It seems like the SMB support detection and therefore also NTLM and for that Win32 Crypto detection will need to be moved into the configure scripts in order to make tests 1013 and 1014 work correctly. I will take a look at updating this PR accordingly. |
Move the definition of USE_WIN32_CRYPTO from config-win32.h to general curl_setup.h to make it work with configure builds. Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO and USE_NTLM for SMB. Remove USE_WIN32_CRYPTO from CMake as it is defined internally. Align condition for NTLM features via CMake with configure builds. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
07ac5da
to
1e8b97b
Compare
Move the definition of USE_WIN32_CRYPTO from config-win32.h to general curl_setup.h to make it work with configure builds. Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO and USE_NTLM for SMB. Remove USE_WIN32_CRYPTO from CMake as it is defined internally. Part of curl#6277
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 Simulate USE_WIN32_CRYPTO detection by checking for CryptCreateHash in wincrypt.h which is not available in Windows App environment. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
1e8b97b
to
a757a48
Compare
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 Simulate USE_WIN32_CRYPTO detection by checking for CryptCreateHash in wincrypt.h which is not available in Windows App environment. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
a757a48
to
42680c2
Compare
This whole comment is obsolete, see #6277 (comment): Just pushed a new approach which aligns CMake and configure builds and leads to the following situation:
Previously @bagder is that okay, or is this kind of split-brain situation unwanted and the logic needs to be completely revamped? |
Move the definition of USE_WIN32_CRYPTO from config-win32.h to general curl_setup.h to make it work with configure builds. Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO and USE_NTLM for SMB. Remove USE_WIN32_CRYPTO from CMake as it is defined internally. Part of curl#6277
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 Simulate USE_WIN32_CRYPTO detection by checking for CryptCreateHash in wincrypt.h which is not available in Windows App environment. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
42680c2
to
83da2af
Compare
Move the definition of USE_WIN32_CRYPTO from config-win32.h to general curl_setup.h to make it work with configure builds. Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO and USE_NTLM for SMB. Remove USE_WIN32_CRYPTO from CMake as it is defined internally. Part of curl#6277
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 Simulate USE_WIN32_CRYPTO detection by checking for CryptCreateHash in wincrypt.h which is not available in Windows App environment. Consolidate additions of crypt32 to linked libraries. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
83da2af
to
2194c11
Compare
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 Simulate USE_WIN32_CRYPTO detection by checking for CryptCreateHash in wincrypt.h which is not available in Windows App environment. Consolidate additions of crypt32 to linked libraries. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
2194c11
to
4d056da
Compare
Move the definition of USE_WIN32_CRYPTO from config-win32.h to general curl_setup.h to make it work with configure builds. Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO and USE_NTLM for SMB. Remove USE_WIN32_CRYPTO from CMake as it is defined internally. Part of curl#6277
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 Simulate 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. Closes curl#6277
4d056da
to
5f1a6b5
Compare
TODO via separate PR once landed: update |
Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO in config-win32.h. Part of curl#6277
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. Use SIZEOF_CURL_OFF_T instead of invalid CURL_SIZEOF_CURL_OFF_T. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
c5d329f
to
deaaf99
Compare
@MarcelRaad I just updated this PR and #6277 (comment) is now obsolete. Instead everything should be as one would expect, e.g. |
Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO in the included config-win32.h in case no build system is used. Part of curl#6277
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. Use SIZEOF_CURL_OFF_T instead of invalid CURL_SIZEOF_CURL_OFF_T. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
deaaf99
to
a6226fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Some CI tests are still failing, but in general this looks good to me. |
Autotools based builds are fully functional now, but CMake still does not work reliable. Adding some debug commits... |
Move the detection of the restricted Windows App environment before the definition of USE_WIN32_CRYPTO in the included config-win32.h in case no build system is used. Part of curl#6277
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. Use SIZEOF_CURL_OFF_T instead of invalid CURL_SIZEOF_CURL_OFF_T. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
bc0761d
to
8ff51d2
Compare
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. Use SIZEOF_CURL_OFF_T instead of invalid CURL_SIZEOF_CURL_OFF_T. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
8ff51d2
to
dfa4a74
Compare
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. Use SIZEOF_CURL_OFF_T instead of invalid CURL_SIZEOF_CURL_OFF_T. Fix condition of Schannel SSL backend in CMake build. Closes curl#6277
dfa4a74
to
8356f7f
Compare
CMake builds now also correctly handle crypt32, NTLM and SMB support, but the fix to Largefile detection does not work, see #6277 (comment). Thinking about doing a separate PR for that one then. |
Move the detection of the restricted Windows App environment in curl_setup.h before the definition of USE_WIN32_CRYPTO via included config-win32.h in case no build system is used. Reviewed-by: Marcel Raad Part of curl#6277
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 curl#6277
8356f7f
to
fdeb031
Compare
Move the detection of the restricted Windows App environment in curl_setup.h before the definition of USE_WIN32_CRYPTO via included config-win32.h in case no build system is used. Reviewed-by: Marcel Raad Part of curl#6277
Align conditions for NTLM features between CMake and configure
builds by differentiating between
USE_NTLM
andUSE_CURL_NTLM_CORE
,just like
curl_setup.h
does internally to detect support of:USE_NTLM
: required for NTLM crypto authentication featureUSE_CURL_NTLM_CORE
: required for SMB protocolImplement
USE_WIN32_CRYPTO
detection by checking for Crypt functionsin
wincrypt.h
which are not available in the Windows App environment.Link
advapi32
andcrypt32
for Crypto API and Schannel SSL backend.Fix condition of Schannel SSL backend in CMake build.
Move the detection of the restricted Windows App environment
in
curl_setup.h
before the definition ofUSE_WIN32_CRYPTO
via included
config-win32.h
in case no build system is used.