curl-7.53.0\lib\urldata.h(411) : error C2061: syntax error : identifier 'CtxtHandle' #1276

Closed
jveazey opened this Issue Feb 22, 2017 · 12 comments

Projects

None yet

7 participants

@jveazey
jveazey commented Feb 22, 2017 edited

Compiling on Windows 10 with Visual Studio 2010 SP1 generates errors, when using OpenSSL 1.1.0e with SSPI enabled. Normally, I don't actually specify ENABLE_SSPI in the command line, but it is enabled by default. I've been using this same command line for a number of releases of curl. So, I'm not doing anything new.

If I use WinSSL and enable SSPI, it compiles fine.
If I use OpenSSL and disable SSPI, it compiles fine.

I'm guessing that SSPI is now somehow tied to WinSSL.

Edit: Added OpenSSL version

I did this

nmake /f MakeFile.vc mode=static RTLIBCFG=static VC=10 WITH_SSL=static WITH_ZLIB=static GEN_PDB=yes MACHINE=x86 MAKE="NMAKE /e" SSL_LIBS="libssl.lib libcrypto.lib crypt32.lib user32.lib"

I saw the following output

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

configuration name: libcurl-vc10-x86-release-static-ssl-static-zlib-static-ipv6-sspi
cl /O2 /DNDEBUG /MT /DCURL_STATICLIB /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /I"../../deps/include" /DUSE_OPENSSL /I"../../deps/include/openssl" /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /Fo"..\builds\libcurl-vc10-x86-release-static-ssl-static-zlib-static-ipv6-sspi-obj-lib/file.obj" ..\lib\file.c
file.c
../../deps/include\openssl/lhash.h(198) : warning C4090: 'function' : different 'const' qualifiers
c:\projects\curl-7.53.0\lib\urldata.h(411) : error C2061: syntax error : identifier 'CtxtHandle'
c:\projects\curl-7.53.0\lib\urldata.h(423) : error C2059: syntax error : '}'
c:\projects\curl-7.53.0\lib\urldata.h(1343) : error C2079: 'digest' uses undefined struct 'digestdata'
c:\projects\curl-7.53.0\lib\urldata.h(1344) : error C2079: 'proxydigest' uses undefined struct 'digestdata'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\NMAKE.EXE"' : return code '0x2'
Stop.

curl/libcurl version

curl-7.53.0

operating system

Windows 10 compiling with Visual Studio 2010 SP1

@vszakats
Contributor
vszakats commented Feb 22, 2017 edited

I can confirm it. As @bagder already linked to it, it is caused by commit f77dabe.

Log: https://ci.appveyor.com/project/vsz/harbour-deps/build/1.0.981#L3532

@jveazey
jveazey commented Feb 22, 2017

Adding this to urldata.h seems to fix the problem

#ifdef USE_WINDOWS_SSPI
#include "curl_sspi.h"
#endif

@vszakats
Contributor
vszakats commented Feb 22, 2017 edited

Testing a similar patch, results in a few minutes:

diff --git a/lib/urldata.h b/lib/urldata.h
index 648b3e81d..7f87913a9 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -136,8 +136,10 @@
 #undef realloc
 #endif /* USE_AXTLS */
 
-#ifdef USE_SCHANNEL
+#if defined(USE_SCHANNEL) || defined(USE_WINDOWS_SSPI)
 #include "curl_sspi.h"
+#endif
+#ifdef USE_SCHANNEL
 #include <schnlsp.h>
 #include <schannel.h>
 #endif

UPDATE: Success

@vszakats vszakats added a commit to vszakats/harbour-deps that referenced this issue Feb 22, 2017
@vszakats vszakats local patch to make curl build with sspi+openssl 1dd648c
@jay jay added a commit that referenced this issue Feb 22, 2017
@vszakats @jay vszakats + jay urldata: include curl_sspi.h when Windows SSPI is enabled
f77dabe broke builds in Windows using Windows SSPI but not Windows SSL.

Bug: #1276
Reported-by: jveazey@users.noreply.github.com
f4739f6
@jay
Member
jay commented Feb 22, 2017 edited

Thanks guys. I had tested f77dabe using Windows SSL and SSPI in Windows 7. I think we should have a CI test combination for SSPI and another SSL backend like OpenSSL. Using that combo I see it also:

urldata.h:411:3: error: unknown type name 'CtxtHandle'

I landed Viktor's fix in f4739f6. I expect other people will run into this issue in the just released source so maybe we should leave this issue open for a bit.

@bagder
Member
bagder commented Feb 22, 2017

Is this issue reason enough to consider a follow-up patch release ahead of schedule?

@jay
Member
jay commented Feb 22, 2017

winbuild makefile defaults to SSPI enabled regardless of SSL backend. I know a fair amount of people use winbuild for Windows builds but I don't know what SSL backends they're using. I'd imagine based on the poll results that show an overwhelming popularity for libcurl w/OpenSSL that it will be an issue that affects a number of people. How about delay the feature window for a few days and see how many reports or +1s or whatever come in for this?

@bagder
Member
bagder commented Feb 22, 2017

👍

@Jan-E
Contributor
Jan-E commented Feb 22, 2017

I ran into this issue as well. And probably the PHP developers will experience the same, using https://github.com/winlibs/cURL

@weltling: did you already try to build 7.53.0 (with nghttp2) ?

@weltling
Contributor

Met this issue as well, f4739f6 fixes it. No issues sighted, other than that. IMHO could make sense to have an official fix release, as 7.53.0 contains a security fix. Otherwise, just applying the aforementioned revision is sure something one can live with.

Thanks.

@Jan-E
Contributor
Jan-E commented Feb 22, 2017

Guess Steffen of https://www.apachelounge.com will run into the same.

@bagder bagder added the build label Feb 22, 2017
@mabrand mabrand added a commit to mabrand/curl that referenced this issue Feb 23, 2017
@vszakats @mabrand vszakats + mabrand urldata: include curl_sspi.h when Windows SSPI is enabled
f77dabe broke builds in Windows using Windows SSPI but not Windows SSL.

Bug: curl#1276
Reported-by: jveazey@users.noreply.github.com
(cherry picked from commit f4739f6)
a893a95
@weltling weltling added a commit to winlibs/cURL that referenced this issue Feb 23, 2017
@vszakats @weltling vszakats + weltling urldata: include curl_sspi.h when Windows SSPI is enabled
f77dabe broke builds in Windows using Windows SSPI but not Windows SSL.

Bug: curl/curl#1276
Reported-by: jveazey@users.noreply.github.com
9e290a3
@kdekker
kdekker commented Feb 23, 2017 edited

Note that I've sent a notification to the OpenSSL guys about lhash.h. They use some macro's to construct things, but there is something wrong there (and quite difficult to fix), see: openssl/openssl#2214. The lhash.h issue is indendent from cURL AFAIK, but related to openSSL 1.1.0 (any version).

I ran into the same issues when I tried out cURL 7.53.0 (with openSSL 1.1.0e and previously 1.1.0d with cURL 7.52.1)

@bagder
Member
bagder commented Feb 24, 2017

We just shipped 7.53.1 that contains this fix.

@bagder bagder closed this Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment