https://bugs.winehq.org/show_bug.cgi?id=47432
Bug ID: 47432 Summary: bcrypt always chooses ECB mode when using AES, even if a program indicates otherwise. Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: bcrypt Assignee: wine-bugs@winehq.org Reporter: hibbsncc1701@gmail.com Distribution: ---
When selecting the block chaining mode to use with AES, wine's bcrypt implementation never checks the full length of the mode string given. On my system the call to strncmpW() only checks the first 8 bytes.
As a result, ECB mode is always chosen regardless as to the mode chosen by the caller. This issue is present in both key_set_property() in gnutls.c and set_alg_property() in bcrypt_main.c. I cannot test mac systems, so I cannot tell if it affects macos.c.
https://bugs.winehq.org/show_bug.cgi?id=47432
--- Comment #1 from Patrick Hibbs hibbsncc1701@gmail.com --- Created attachment 64779 --> https://bugs.winehq.org/attachment.cgi?id=64779 Fix for key_set_property()
https://bugs.winehq.org/show_bug.cgi?id=47432
--- Comment #2 from Patrick Hibbs hibbsncc1701@gmail.com --- Created attachment 64780 --> https://bugs.winehq.org/attachment.cgi?id=64780 Fix for set_alg_property()
https://bugs.winehq.org/show_bug.cgi?id=47432
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- Created attachment 64821 --> https://bugs.winehq.org/attachment.cgi?id=64821 patch
Looks like the size parameter is ignored for the BCRYPT_CHAINING_MODE property. Can you try this patch?
https://bugs.winehq.org/show_bug.cgi?id=47432
--- Comment #4 from Patrick Hibbs hibbsncc1701@gmail.com --- (In reply to Hans Leidekker from comment #3)
Created attachment 64821 [details] patch
Looks like the size parameter is ignored for the BCRYPT_CHAINING_MODE property. Can you try this patch?
Your patch works for me.
https://bugs.winehq.org/show_bug.cgi?id=47432
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=47432
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |691fcebf3d0d403fe6817821fbe | |28bc25f983051 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Hans Leidekker hans@meelstraat.net --- Fixed by 691fcebf3d0d403fe6817821fbe28bc25f983051.
https://bugs.winehq.org/show_bug.cgi?id=47432
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.13.
https://bugs.winehq.org/show_bug.cgi?id=47432
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.0.x
https://bugs.winehq.org/show_bug.cgi?id=47432
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.x |---
--- Comment #7 from Michael Stefaniuc mstefani@winehq.org --- Removing the 4.0.x milestone from bug fixes included in 4.0.3.