[Bug 60345] New: rsaenh: CryptSetHashParam(HP_HMAC_INFO) with CALG_SHA_256 on PROV_RSA_FULL reports success but leaves the hash uninitialized; next CryptHashData() crashes (Aniimo, Steam 4126040)
http://bugs.winehq.org/show_bug.cgi?id=60345 Bug ID: 60345 Summary: rsaenh: CryptSetHashParam(HP_HMAC_INFO) with CALG_SHA_256 on PROV_RSA_FULL reports success but leaves the hash uninitialized; next CryptHashData() crashes (Aniimo, Steam 4126040) Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: rsaenh Assignee: wine-bugs@list.winehq.org Reporter: gustavo.karsten@outlook.com Target Milestone: --- Distribution: --- Created attachment 82117 --> http://bugs.winehq.org/attachment.cgi?id=82117 backtrace Aniimo (Steam AppID 4126040, NetEase) launches and logs in, then crashes when the server list should appear. Same crash on Proton (https://github.com/ValveSoftware/Proton/issues/10150) and CrossOver 26.2/26.3 (Wine 11.0 base); dlls/rsaenh in current git has the same code. Backtrace (CrossOver 26.2, Wine 11.0 base, macOS/Apple Silicon): Unhandled exception: page fault on read access to 0x0000000000000060 in 64-bit code =>0 rsaenh (+0x24b2e) callq *0x60(%rax) rax=0 1 rsaenh (+0x56d3) 2 advapi32 (+0x10d0f) 3 fpxsteam (+0x4be69) (NetEase's Steam auth layer, FPXSteam.dll) What the game does (minimal sequence, reproduces the crash on current Wine, works on Windows): CryptAcquireContext(PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) CryptCreateHash(CALG_HMAC, hKey) CryptSetHashParam(HP_HMAC_INFO, { HashAlgid = CALG_SHA_256 }) -> returns TRUE on both Wine and Windows CryptHashData(...) -> Wine crashes here Analysis: in dlls/rsaenh/rsaenh.c, init_hash() for CALG_HMAC looks the inner hash algorithm up with get_algid_info(); SHA-256 is not in the RSA full providers' table, so it returns FALSE (there is already a FIXME there saying that Windows supports e.g. SHA-256 for HMAC even on providers that don't list it). RSAENH_CPSetHashParam(HP_HMAC_INFO) ignores init_hash()'s return value and returns TRUE, so pHMACInfo is set while the hash descriptor stays NULL. update_hash() then calls update_hash_impl(), which dereferences the NULL descriptor (the call through offset 0x60 in the trace). Expected behavior (Windows): the HMAC is computed with SHA-256. CryptCreateHash(CALG_SHA_256) itself does fail with NTE_BAD_ALGID on PROV_RSA_FULL, as the existing tests already check, but HP_HMAC_INFO accepts it. Verified indirectly: the game works on Windows, and rebuilding rsaenh.dll with the inner-hash lookup falling back to the AES provider's table makes the game work end to end on CrossOver (RFC 4231 HMAC-SHA-256 vectors then pass on the Base, Strong and Enhanced providers). Note: the analysis above was done with the help of an AI assistant. In line with the WineHQ LLM policy no patch is 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=60345 Hans Leidekker <hans@meelstraat.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |4352d975bea6bd4d453b7d4e887 | |5cc4b2335cfc4 --- Comment #1 from Hans Leidekker <hans@meelstraat.net> --- Should be fixed with 4352d975bea6bd4d453b7d4e8875cc4b2335cfc4. -- 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=60345 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.19. -- 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