AtomicTorch Studio Forums

CryoFall => Bug reports => Topic started by: gigafunk on April 28, 2020, 05:51:08 am

Title: Dotnet core version proton
Post by: gigafunk on April 28, 2020, 05:51:08 am

Carrying this over from the steam forum.

I have been poking around with this, far out of my league and found a log file entry that I did not see shared before, though I could be wrong.

line 29 is the interesting one

System.Security.Cryptography. CryptographicException: Padding is invalid and cannot be removed

I know you had it narrowed down to that so I figured this might help, although it seems its out of your control and in wine, and maybe its a good clue for the wine crew to see and maybe its at the heart of a larger .net bug.   Ill go post it on whatever wine has for a bug tracker, after I track it down.  Proton has one but its for games that are already certified or whatever verbage they use.

Thanks for all your effort on this, its really cool and exciting.  I just made the switch from windows 10 and every game I have tried works in proton.  Ill update this post with any news from the wine world.

Ok first I see that the 5.7 version of wine that was release on april 18th I think, updated mono from 4.9.7 (i think) to 5.0.0.  So Sooner or later Glorious Egroll will probably release proton compiled against this newer version, so I am going to hold off bug reporting with wine until after that and I test it.

After tons of google, and not knowing much, and based on everything you typed

Maybe that the call SHOULD be made against the standalone binary, but mono has that method and wine is calling it instead, and the mono method is assumes the wrong padding size vs the MS one? 
I read you MAY be able to workaround it by explicitly stating the padding size for both decryption and encryption, but that a workaround for a "bug" in an unsupported system , and that might be total crap

I will test this as soon as i can get ahold of a test proton compiled against wine 5.7 and update this and then proceed to wine bug reporting.
Title: Re: Dotnet core version proton
Post by: ai_enabled on April 28, 2020, 04:23:06 pm

KeySize, BlockSize, and Padding mode are already explicitly set. The padding mode is PKCS7. The algorithm is AES256.

I'm quite certain there is an issue with AES256 in .NET Core under Proton as our master server had trouble decrypting AES256-encrypted messages from the client run under Proton, and now you've posted a log that suggests similar issue on the client side (though this file seems to be encrypted on the client side just to store it securely).

It's not viable to adjust any of these encryption parameters just for an experiment as it would break the infrastructure compatibility with the legacy versions of the game and require major infrastructure redeployment. We've used the same approach for years and it worked fine.

I wish it was possible to just use the Linux version of .NET Core instead of Mono in Wine, as it should be 100% compatible...but yes, there is a major issue with missing WinForms API.

Title: Re: Dotnet core version proton
Post by: gigafunk on May 14, 2020, 07:08:23 pm
Course it couldn't be that easy as to set padding! Thanks for the info,

The new release of wine with the mono update  was rolled into a new version of the custom proton made by "Glorious Eggroll" I spoke of earlier. 

I tried it, and the same thing. In the proton log I can see where it loads cryofalls included shared binary, but I can also see it loading one as part or the "Proton" set of changes to wine. I tried vanilla wine of this version and it didnt work either,  I am going to dig a little bit and see if its easy to turn off the Proton loading of their own dotnet stuff. This is on top of the wine mono environment.

Next i will delve into trying to turn off that from loading into the proton "prefix".

Anyhow, Ill keep updates here for the curious

I ended up firing up my windows partition to play this, but im still going to probably fruitlessly hack away at it.
Title: Re: Dotnet core version proton
Post by: ai_enabled on November 22, 2020, 05:44:52 pm
I've investigated the issues with the .NET Core version of the game. There were mostly around the AES encryption and I've found a reliable workaround (cannot use CryptoStream API but works fine with TransformBlock method; it was a nightmare to investigate and produce dozens of test game builds though!).

Here are the details about the new Proton-compatible build

BTW, the .NET Framework branch is broken with the latest version of Proton due to script compilation issues with our embedded C# compiler (it just cannot resolve types properly due to massive internal conflict between Mono and included assemblies that are also essential). I hope the .NET Core version will work fine for everyone and finally we can have a single game build compatible with both Windows and Proton.