[reSIProcate] WinSecurity compiler error

Dario Bozzali Dario.Bozzali at ifmgroup.it
Tue May 13 03:57:28 CDT 2014


Hi Scott,
to complete discussion I want to notice that parameter dwFlags in CryptAcquireCertificatePrivateKey() function is set to 0, so (according to documentation, as I understood) we use only CryptoAPI on all platforms and not Cryptography Next Generation (CNG).
As a consequence dwKeySpec is never CERT_NCRYPT_KEY_SPEC and we will call always CryptReleaseContext() function.
Anyway we could leave the last changes to WinSecurity if in the future we wanted to use new APIs.
Best regards,
Dario.


From: slgodin at gmail.com [mailto:slgodin at gmail.com] On Behalf Of Scott Godin
Sent: lunedì 12 maggio 2014 21.20
To: Dario Bozzali
Cc: resiprocate-devel at resiprocate.org
Subject: Re: [reSIProcate] WinSecurity compiler error

Looks good to me - I will commit this - thanks!

Scott

On Mon, May 12, 2014 at 11:58 AM, Dario Bozzali <Dario.Bozzali at ifmgroup.it<mailto:Dario.Bozzali at ifmgroup.it>> wrote:
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.


_______________________________________________
resiprocate-devel mailing list
resiprocate-devel at resiprocate.org<mailto:resiprocate-devel at resiprocate.org>
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

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


More information about the resiprocate-devel mailing list