Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add Windows header for CRYPT_E_REVOKED macro #411
Starting with curl 7.44.0 , compiling source file
This happens when using mingw distros that ship with Windows headers
One solution is to comply with MSDN by #include-ing
This patch also fixes a TAB indentation.
Starting with curl 7.44.0 , 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  CI platforms. `w32api` developers implemented  this macro strictly per MSDN , 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. ) 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.  de74e85  http://www.appveyor.com/docs/installed-software#mingw-msys-cygwin  https://sourceforge.net/u/cstrauss/w32api/ci/3dd1f4b7cb6ab8da80e4c2bbcdb629c8c43b0d6b/  https://msdn.microsoft.com/en-us/library/windows/desktop/aa377167.aspx  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: