http://bugs.winehq.org/show_bug.cgi?id=45746 --- Comment #15 from nayuta65535@gmail.com --- (In reply to Hans Leidekker from comment #14)
PFXImportCertStore() may work now but as described in this bug a password dialog should be shown for password protected PFX files. I think we should focus this bug on that part.
Happy to. One clarification about what the bug describes, and one thing I found while looking at it. The password dialog in comments #6, #10 and #11 is MetaTrader's own, not Wine's, and it only appeared once native crypt32 had been installed through winetricks. With builtin crypt32 the reporter got no password prompt at all, because the file was not recognised as a PFX in the first place - that is the CryptQueryObject part, fixed by 962aed51205. The wine control reproducer in comment #8 also stops at "file did not recognized", before any password could be entered. So if the bug is to be about Wine's own import wizard prompting for a PFX password, that is a fair thing to track, but it is not something the wizard is close to doing today: it cannot get as far as needing a password. CryptQueryObject identifies a PFX but hands back a NULL store. Measured on an unmodified wine-11.16 build with a fresh prefix, against two PKCS#12 files generated with openssl, one with a password and one without: secret.pfx ret=1 contentType=12 (CERT_QUERY_CONTENT_PFX) store=0000000000000000 nopass.pfx ret=1 contentType=12 (CERT_QUERY_CONTENT_PFX) store=0000000000000000 That is CRYPT_QueryPFXObject in dlls/crypt32/object.c, which sets *phCertStore to NULL for a PFX and only reports the content type. cryptui's import path takes only that store handle: dlls/cryptui/main.c open_store_from_file() -> CryptQueryObject(..., &store, ...) dlls/cryptui/main.c import_file() -> if (!source) return FALSE so import_file() fails for any PFX, password protected or not. There is no PFXImportCertStore call anywhere in dlls/cryptui; the PFX support there is export-only (save_pfx, PFXExportCertStore and the IDD_EXPORT_PASSWORD page). The import side has no counterpart. The remaining work therefore looks like a PFX branch in the import wizard: a password page, and a PFXImportCertStore call with what the user typed, rather than relying on the store handle from CryptQueryObject. I have not checked what Windows returns for phCertStore on a PFX, so I do not know whether the NULL store is itself a deviation or just something cryptui has to work around. The original MetaTrader symptom I still cannot confirm - comment #12 asked for the broker's certificate and it was never provided, and I do not have one. -- 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.