http://bugs.winehq.org/show_bug.cgi?id=60190 Bug ID: 60190 Summary: rsaenh: Wrong private exponent for RSA keys with public exponent 1 Product: Wine Version: 11.15 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: rsaenh Assignee: wine-bugs@list.winehq.org Reporter: Urias.Uhle@web.de Target Milestone: --- Distribution: --- Autodesk Fusion 360 renders a black 3D canvas since Wine 11.11 while its Qt interface works. The cause is not graphics related. This supersedes bug 60010, which I filed against win32u before the root cause was known. Fusion imports a 512 bit RSA private key whose public exponent is 1 through CryptImportKey. Before 11.11 libtomcrypt handled that key. Since d22453b rsaenh uses SymCrypt, which rejected it; 0cb249ce (!11182) made the import succeed again. The import succeeds now, but the derived private key is wrong. SymCryptRsakeyCalculatePrivateFields() in libs/symcrypt/lib/rsakey.c computes the private exponent with SymCryptIntExtendedGcd(), which derives the inverse as -((B1*Src1 - Gcd)/Src2) mod Src1. That does not hold for Src2 == 1, so the private exponent and both CRT exponents come out wrong. The public operation is correct, the private one is not, so Fusion's 3D subsystem never initialises. With e == 1 both RSA operations are the identity, m^1 mod n == m, so the private exponent has to be 1 as well. Setting piPrivExps[i] to 1 directly when au64PubExp[i] == 1, and skipping the gcd path, makes d, dp and dq come out as 1 and both operations become the identity again. I verified that on 11.14 and on current master, and ordinary RSA keys stay byte identical. test_pubexp() in dlls/rsaenh/tests/rsaenh.c only imports the key, which is why this was not caught. An encrypt and decrypt round trip with the same blob shows it. I am not opening a merge request, because I worked this out with LLM assistance and the WineHQ contributor policies ask contributors to refrain from that. -- 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.