-
-
Notifications
You must be signed in to change notification settings - Fork 226
MD5 causes cryptographic exception if FIPS is enabled on Windows #701
Copy link
Copy link
Closed
Description
Description
Recently moved to a new work machine where FIPS is enabled and got an System.InvalidOperationException from the MD5CryptoServiceProvider when trying to instantiate via MD5.Create in the utility method GetMD5Hash (code).
Repro
- Have a windows machine where FIPS is enforced. How to enable
- Open a binlog
- Right click a project node > Preprocess
- Exception is thrown and you can't view the XML file
Version: 2.1.844
.NetFramework 4.7.2
Resolution
I'm more than willing to fix this as it's a very simple fix. Documentation here (https://github.com/microsoft/dotnet/blob/b5f52bf00618f7ccd62b04a5a2fa94b71241a88a/Documentation/compatibility/cryptographicexception-not-thrown-in-fips-mode.md) states that .NetFramework 4.7.2 will throw by default but this was relaxed in .NetFramework 4.8
Either,
- Upgrade to .NetFramework to 4.8 so the exception isn't thrown anymore
- Add
<AppContextSwitchOverrides value="Switch.System.Security.Cryptography.UseLegacyFipsThrow=false" />to theruntimesection ofApp.configif planning to stay on .NetFramework 4.7.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels