Add Windows header for CRYPT_E_REVOKED macro#411
Add Windows header for CRYPT_E_REVOKED macro#411vszakats wants to merge 1 commit intocurl:masterfrom vszakats:patch-3
Conversation
Starting with curl 7.44.0 [1], compiling source file `lib/strerror.c`
with mingw and SSPI enabled, may fails with error:
```
strerror.c: In function 'Curl_sspi_strerror':
strerror.c:827:10: error: 'CRYPT_E_REVOKED' undeclared (first use in this function)
case CRYPT_E_REVOKED:
^
```
This happens when using mingw distros that ship with Windows headers
via the `w32api` package. Such distro is the canonical one, which is
also used by certain [2] CI platforms. `w32api` developers implemented
[3] this macro strictly per MSDN [4], solely adding it to `wincrypt.h`,
This made it incompatible with official Windows headers which define
it in `winerror.h`. Other mingw distros (f.e. [5]) that use the WINE
headers, work fine.
One solution is to comply with MSDN by #include-ing `<wincrypt.h>`
via `lib/curl_setup.h`.
This patch also fixes a TAB indentation.
[1] de74e85
[2] http://www.appveyor.com/docs/installed-software#mingw-msys-cygwin
[3] https://sourceforge.net/u/cstrauss/w32api/ci/3dd1f4b7cb6ab8da80e4c2bbcdb629c8c43b0d6b/
[4] https://msdn.microsoft.com/en-us/library/windows/desktop/aa377167.aspx
[5] https://sourceforge.net/projects/mingw-w64
|
Not sure why the CI failure, it doesn't seem to be related to this patch, given that it compiles Anyhow an extra guard of Or, for extra safety a |
|
Here's the error in action on AppVeyor CI: Here's a successful build run that uses the patch: |
|
It may be better to just define CRYPT_E_REVOKED ourselves. It is the only CRYPT_ code that schannel will return afaict. @vszakats can you try |
|
If such solution is okay in curl and it's used already, it's definitely much simpler, in fact this was how I fixed it first, but went the "official" way instead. Build is okay with the new patch: |
Bug: #411 Reported-by: Viktor Szakats
|
Thanks, landed in df6a4d3. |
|
Thank you @jay! |
Bug: curl#411 Reported-by: Viktor Szakats
Starting with curl 7.44.0 [1], compiling source file
lib/strerror.cwith mingw and SSPI enabled, may fail with error:
This happens when using mingw distros that ship with Windows headers
via the
w32apipackage. Such distro is the canonical one, which isalso offered by certain [2] CI platforms.
w32apidevelopers implemented[3] this macro strictly per MSDN [4], solely adding it to
wincrypt.h,This made it incompatible with original Windows SDK headers which define
it in
winerror.h. Other mingw distros (f.e. [5]) that use the WINEheaders, work fine.
One solution is to comply with MSDN by #include-ing
<wincrypt.h>via
lib/curl_setup.h.This patch also fixes a TAB indentation.
[1] de74e85
[2] http://www.appveyor.com/docs/installed-software#mingw-msys-cygwin
[3] https://sourceforge.net/u/cstrauss/w32api/ci/3dd1f4b7cb6ab8da80e4c2bbcdb629c8c43b0d6b/
[4] https://msdn.microsoft.com/en-us/library/windows/desktop/aa377167.aspx
[5] https://sourceforge.net/projects/mingw-w64