[reSIProcate] WinSecurity compiler error

Dario Bozzali Dario.Bozzali at ifmgroup.it
Mon May 12 10:58:04 CDT 2014


Hi all,
I updated my Resiprocate repository to last revision (11170).
I tried to build Resiprocate using reSIProcate_8_0.sln (my operating system is Windows 8.1) and I obtained the following error in WinSecurity.cxx:
1>WinSecurity.cxx
1>.\ssl\WinSecurity.cxx(357) : error C2065: 'CERT_NCRYPT_KEY_SPEC' : undeclared identifier
1>.\ssl\WinSecurity.cxx(359) : error C3861: 'NCryptFreeObject': identifier not found
Instead using reSIProcate_9_0.sln WinSecurity.cxx compiles properly.
I understood that the issue is due to Wincrypt.h. On Windows XP and Windows 2003 CERT_NCRYPT_KEY_SPEC is undefined, so dwKeySpec cannot be CERT_NCRYPT_KEY_SPEC.
Is it possible to change the code to build successfully also using Visual C++ 2005?
Could the following code work fine?
                if(bCallerFreeProvOrNCryptKey)
                {
#if(_WIN32_WINNT >= 0x0600)
                    if(dwKeySpec == CERT_NCRYPT_KEY_SPEC)
                    {
                        NCryptFreeObject(hCryptProv);
                    }
                    else
                    {
                        CryptReleaseContext(hCryptProv, 0);
                    }
#else
                    CryptReleaseContext(hCryptProv, 0);
#endif // if(_WIN32_WINNT >= 0x0600)
                }

Thank you in advance.
Best regards,
Dario.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140512/fce05c83/attachment.htm>


More information about the resiprocate-devel mailing list