< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] WinSecurity compiler error


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@xxxxxxxxx [mailto:slgodin@xxxxxxxxx] On Behalf Of Scott Godin
Sent: lunedì 12 maggio 2014 21.20
To: Dario Bozzali
Cc: resiprocate-devel@xxxxxxxxxxxxxxx
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@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel