Skip to content
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

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
Labels

Comments

@jveazey
Copy link

jveazey commented Feb 22, 2017

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
Copy link
Member

vszakats commented Feb 22, 2017

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
Copy link
Author

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
Copy link
Member

vszakats commented Feb 22, 2017

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 added a commit to curl/curl-for-win that referenced this issue Feb 22, 2017
jay pushed a commit that referenced this issue Feb 22, 2017
f77dabe broke builds in Windows using Windows SSPI but not Windows SSL.

Bug: #1276
Reported-by: jveazey@users.noreply.github.com
@jay
Copy link
Member

jay commented Feb 22, 2017

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
Copy link
Member

bagder commented Feb 22, 2017

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

@jay
Copy link
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
Copy link
Member

bagder commented Feb 22, 2017

👍

@Jan-E
Copy link
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
Copy link
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
Copy link
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
weltling pushed a commit to winlibs/cURL that referenced this issue Feb 23, 2017
f77dabe broke builds in Windows using Windows SSPI but not Windows SSL.

Bug: curl/curl#1276
Reported-by: jveazey@users.noreply.github.com
@kdekker
Copy link
Contributor

kdekker commented Feb 23, 2017

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
Copy link
Member

bagder commented Feb 24, 2017

We just shipped 7.53.1 that contains this fix.

@bagder bagder closed this as completed Feb 24, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

7 participants