[Bug 59460] New: bcrypt: Implement RSA-OAEP padding defaults (fixes Wallpaper Engine mobile sync)
http://bugs.winehq.org/show_bug.cgi?id=59460 Bug ID: 59460 Summary: bcrypt: Implement RSA-OAEP padding defaults (fixes Wallpaper Engine mobile sync) Product: Wine Version: 11.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: bcrypt Assignee: wine-bugs@list.winehq.org Reporter: sreehari7102008@gmail.com Distribution: --- Created attachment 80447 --> http://bugs.winehq.org/attachment.cgi?id=80447 Patch implementing default OAEP padding (SHA-1 + empty label) for BCryptEncrypt when pPaddingInfo is NULL. Fixes Wallpaper Engine mobile sync on Proton. When BCryptEncrypt is called with BCRYPT_PAD_OAEP and pPaddingInfo = NULL (common in many high-level libraries), Windows defaults to SHA-1 hash algorithm with an empty label. The GnuTLS backend in Wine currently requires a full BCRYPT_OAEP_PADDING_INFO structure even for encryption and returns STATUS_INVALID_PARAMETER. This breaks RSA-OAEP handshakes in several applications, notably the mobile device pairing / sync feature in Wallpaper Engine. This patch makes the encryption path match real Windows behaviour: - if pPaddingInfo == NULL → use SHA-1 + empty label - otherwise use the supplied hash and label (label may still be empty) Decryption side remains unchanged (still requires pszAlgId, which matches Windows). Tested on Proton 10 with Wallpaper Engine mobile pairing — the sync now works. Full patch attached. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 --- Comment #1 from Hans Leidekker <hans@meelstraat.net> --- Looks good, thanks. Would you mind creating an MR at https://gitlab.winehq.org/wine/wine/-/merge_requests? A test case would also be nice. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 Sreehari Anil <sreehari7102008@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80447|0 |1 is obsolete| | --- Comment #2 from Sreehari Anil <sreehari7102008@gmail.com> --- Created attachment 80448 --> http://bugs.winehq.org/attachment.cgi?id=80448 v2: bcrypt OAEP default padding (SHA-1 + empty label) + test case -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 --- Comment #3 from Sreehari Anil <sreehari7102008@gmail.com> --- Hey Hans, Sorry I'm still super new and a bit clueless with all this I tried creating a fork but it says "Limit reached You cannot create projects in your personal namespace. Contact your GitLab administrator." I only added the test case in test_rsa_encrypt() and made this v2 patch. Attaching it here. Could you please create the Merge Request for me? Would really appreciate it! Thank you so much! :) -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 --- Comment #4 from Sreehari Anil <sreehari7102008@gmail.com> --- Quick update: I identified that the GitLab "Limit reached" error is a server-side project limit for new accounts. I've already submitted a verification request to the admins. Once they approve it, I'll open the Merge Request myself with the v2 patch and the new test case. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 --- Comment #5 from Sreehari Anil <sreehari7102008@gmail.com> --- Created attachment 80452 --> http://bugs.winehq.org/attachment.cgi?id=80452 v3: bcrypt OAEP default padding (SHA-1 + empty label) + test case(corrected) Correction: The expected size should be 80, not 64. This test uses the 640-bit key from the OAEP section, which produces 80-byte output. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 Sreehari Anil <sreehari7102008@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80448|0 |1 is obsolete| | -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 Austin English <austinenglish@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 Sreehari Anil <sreehari7102008@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80452|0 |1 is obsolete| | -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59460 Sreehari Anil <sreehari7102008@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WORKSFORME Status|UNCONFIRMED |RESOLVED --- Comment #6 from Sreehari Anil <sreehari7102008@gmail.com> --- Additional context: the Wallpaper Engine failure in my setup was also affected by a broken prefix; this OAEP behavior issue is patched in Wine 10.0+. My earlier statement about “default OAEP padding (SHA-1 + empty label) when pPaddingInfo == NULL” was inaccurate Observed native behavior on Windows 11 24H2 for BCryptEncrypt with BCRYPT_PAD_OAEP: - Size query path (pbOutput == NULL) can succeed and return the required size even when pPaddingInfo == NULL - Actual encryption call (pbOutput != NULL) with pPaddingInfo == NULL returns STATUS_INVALID_PARAMETER This MR aligns Wine behavior with that observed native behavior: - OAEP actual encryption requires padding info (pszAlgId required) - OAEP size-only query remains accepted - Empty OAEP labels are accepted (OAEP SPKI params are set only for non-empty labels) - OAEP SPKI setup failures are handled; GNUTLS_E_UNKNOWN_PK_ALGORITHM maps to STATUS_NOT_SUPPORTED MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/10222 -- 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