https://bugs.winehq.org/show_bug.cgi?id=54821
Bug ID: 54821 Summary: CryptAcquireCertificatePrivateKey implementation ignores CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG Product: Wine Version: 8.4 Hardware: x86-64 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 Assignee: wine-bugs@winehq.org Reporter: mterrisse@free.fr
Hello,
I have recently moved all my code from Crypto API to CNG and it doesn't work with Wine because CryptAcquireCertificatePrivateKey ignores the flag CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG. CryptAcquireCertificatePrivateKey with dwFlags = CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG returns True, but pdwKeySpec isn't equal to CERT_NCRYPT_KEY_SPEC and phCryptProvOrNCryptKey is a handle to a CAPI container handle instead of a ncrypt key.
I have looked at the source code (dlls/crypt32/cert.c) and indeed there is no reference to CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG.
I will try to handle this with NCryptTranslateHandle but I think this should be done in crypt32.dll.
Regards,
Michel Terrisse
https://bugs.winehq.org/show_bug.cgi?id=54821
--- Comment #1 from Michel Terrisse mterrisse@free.fr --- In the same area I notice that PFXImportCertStore doesn't handle the flag PKCS12_ALWAYS_CNG_KSP.
Regards,
Michel Terrisse