https://bugs.winehq.org/show_bug.cgi?id=41604
Bug ID: 41604 Summary: Access violation in CertAddSerializedElementToStore Product: Wine Version: 1.9.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 Assignee: wine-bugs@winehq.org Reporter: mterrisse@free.fr Distribution: ---
Hello,
I am trying to work around this bug https://bugs.winehq.org/show_bug.cgi?id=11070 (importpfx fails, needs PFXImportCertStore implementation).
On Windows (10, 1607) I serialize a certificate to a buffer with CertSerializeCertificateStoreElement, and write this buffer into a file. On Linux (Ubuntu 16.10, PlayOnLinux, Wine 1.9.10) I read the buffer from the file and I import it with CertAddSerializedElementToStore. -> It fails and GetLastError returns STATUS_ACCESS_VIOLATION.
I had a look at the code: in crypt32/serialize.c (1.9.21), CRYPT_ReadSerializedElement, you can read __EXCEPT_PAGE_FAULT { SetLastError(STATUS_ACCESS_VIOLATION); context = NULL; } __ENDTRY So there is really an access violation.
https://bugs.winehq.org/show_bug.cgi?id=41604
Michel Terrisse mterrisse@free.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mterrisse@free.fr
--- Comment #1 from Michel Terrisse mterrisse@free.fr --- Sorry, I wrote 1.9.10, it is in fact 1.9.20
https://bugs.winehq.org/show_bug.cgi?id=41604
--- Comment #2 from Michel Terrisse mterrisse@free.fr --- I tried to understand the crash with winedbg but could not make it work (https://bugs.winehq.org/show_bug.cgi?id=40289) :(
So here is what I get with dbg (ExtracteurPfx.exe is an executable I wrote to test this problem):
gdb --args wine64 C:\TEMP\ExtracteurPfx\ExtracteurPfx.exe r (to run the application until the crash) bt (to have the back trace when it crashes)
Here is just the top of the back trace from CertAddSerializedElementToStore:
Thread 1 "ExtracteurPfx.e" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7fd7f40 (LWP 4941)] __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:444 444 ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S: Aucun fichier ou dossier de ce type. (gdb) bt #0 __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:444 #1 0x00007ffff26cd174 in ?? () from /usr/lib/wine/../x86_64-linux-gnu/wine/./crypt32.dll.so #2 0x00007ffff26cd4f0 in CertSetCertificateContextProperty () from /usr/lib/wine/../x86_64-linux-gnu/wine/./crypt32.dll.so #3 0x00007ffff271b0e5 in ?? () from /usr/lib/wine/../x86_64-linux-gnu/wine/./crypt32.dll.so #4 0x00007ffff271b8e5 in ?? () from /usr/lib/wine/../x86_64-linux-gnu/wine/./crypt32.dll.so #5 0x00007ffff271bd94 in CertAddSerializedElementToStore () from /usr/lib/wine/../x86_64-linux-gnu/wine/./crypt32.dll.so
So it seams that the problem is in CertSetCertificateContextProperty.
I hope this helps. Regards,
Michel Terrisse
https://bugs.winehq.org/show_bug.cgi?id=41604
Jim K wondertones@yandex.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wondertones@yandex.ru
https://bugs.winehq.org/show_bug.cgi?id=41604
David Kahurani k.kahurani@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |k.kahurani@gmail.com
--- Comment #3 from David Kahurani k.kahurani@gmail.com --- It'd probably have been quite easy to debug this had you provided the source for your reproducer.