[Bug 60442] New: crypt32: Store the imported key spec in CRYPT_KEY_PROV_INFO.
http://bugs.winehq.org/show_bug.cgi?id=60442 Bug ID: 60442 Summary: crypt32: Store the imported key spec in CRYPT_KEY_PROV_INFO. Product: Wine Version: 11.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 Assignee: wine-bugs@list.winehq.org Reporter: auzy83@gmail.com Target Milestone: --- Distribution: --- Symptom: After `PFXImportCertStore` imports an RSA key, .NET's `cert.PrivateKey` fails with `NTE_NO_KEY`. Wine today: In `dlls/crypt32/pfx.c`, `set_key_prov_info()`: - fills `dwKeySpec` from `CryptGetProvParam(PP_KEYSPEC)`. That returns the *mask* of supported specs (3), which isn't a valid key spec. - always sets `dwFlags = 0`, which drops `CRYPT_MACHINE_KEYSET` for imports into the machine store. Should do: - Set `dwKeySpec` to the spec the key was really imported with, `AT_KEYEXCHANGE` for a `CALG_RSA_KEYX` import. - Keep `CRYPT_MACHINE_KEYSET` in `dwFlags` when the import used it. Confirm on Windows: `dwKeySpec`, `dwFlags`, `dwProvType` and the provider name for RSA imports with flags 0, `CRYPT_MACHINE_KEYSET` and `CRYPT_USER_KEYSET`. Tests (`dlls/crypt32/tests/store.c`, `test_PFXImportCertStore`): Read `CERT_KEY_PROV_INFO_PROP_ID` back after the import and check each field. Then check that `CryptAcquireContextW` with the returned container name and `dwKeySpec` opens the key. Software Affected: Control4 Composer Pro -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla