http://bugs.winehq.org/show_bug.cgi?id=36765
Bug ID: 36765 Summary: AES 128 works different on "Win7" and on "Wine win7" Product: Wine Version: unspecified Hardware: x86-64 OS: Windows Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 Assignee: wine-bugs@winehq.org Reporter: sergpeganov@gmail.com
Created attachment 48823 --> http://bugs.winehq.org/attachment.cgi?id=48823 src and compiled exe for test
Hello,
I have a windows application that uses CryptoAPI. I've found that encrypted text differs when application runs on real Win7 machine and on Wine. When I encrypt/decrypt the same data on Windows everything works fine. When I encrypt/decrypt the same data on Wine everything works fine too. The problem happens when I encrypt on Windows and decrypt on Wine. I made a simple application to show that encrypted results differ.
Please run cryptoapi_test.exe from the attachement on Windows and on Wine and you will get different results. Src also attached. I also attached the same crypt test on JavaScript and Python for reference (they give the same result as on Windows).
I found the similar bug #28673 but it has a very messy description.
http://bugs.winehq.org/show_bug.cgi?id=36765
Serg sergpeganov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sergpeganov@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=36765
--- Comment #1 from Bruno Jesus 00cpxxx@gmail.com --- Looks like a CBC issue, the second block of data is not being initialized correctly before encryption.
http://bugs.winehq.org/show_bug.cgi?id=36765
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com --- It looks like when you don't specify the chaining mode wine defaults to ECB while the default should to CBC. Javascript and python are using CBC mode.
https://bugs.winehq.org/show_bug.cgi?id=36765
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=36765
--- Comment #3 from Serg sergpeganov@gmail.com --- That's it! Added:
DWORD mode = CRYPT_MODE_CBC; key.SetParam(KP_MODE, (BYTE*)&mode);
And it works. Thanks.
http://bugs.winehq.org/show_bug.cgi?id=36765
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Assignee|wine-bugs@winehq.org |00cpxxx@gmail.com Ever confirmed|0 |1
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com --- Confirming the bug and taking to myself, it will take more time to fix because there is another problem that needs to be fixed first.
http://bugs.winehq.org/show_bug.cgi?id=36765
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |den.aria@gmail.com
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com --- *** Bug 28673 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=36765
--- Comment #6 from den123 den.aria@gmail.com ---
From Bug 28673
Problem has resolved. Very Thanks!
http://bugs.winehq.org/show_bug.cgi?id=36765
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |e55dc350209e15ff9d8c05a12be | |01c93dbd3e318 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #7 from Bruno Jesus 00cpxxx@gmail.com --- Patch commited: http://source.winehq.org/git/wine.git/commitdiff/e55dc350209e15ff9d8c05a12be...
https://bugs.winehq.org/show_bug.cgi?id=36765
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.23.