Skip to content

Commit

Permalink
Merge pull request #73 from bmccormack/master
Browse files Browse the repository at this point in the history
Use SHA256CryptoServiceProvider instead of SHA256. This prevents a FIPS exception from being thrown.
  • Loading branch information
SamSaffron committed Sep 17, 2012
2 parents 2764671 + dd19716 commit ebdffb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions StackExchange.Profiling/MiniProfiler.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ where p.IsDefined(t, inherit: false)
files.AddRange(System.IO.Directory.EnumerateFiles(customUITemplatesPath));
}

using (var sha256 = System.Security.Cryptography.SHA256.Create())
using (var sha256 = new System.Security.Cryptography.SHA256CryptoServiceProvider())
{
byte[] hash = new byte[sha256.HashSize / 8];
foreach (string file in files)
{
// sha256 is FIPS BABY - FIPS
// sha256 can throw a FIPS exception, but SHA256CryptoServiceProvider is FIPS BABY - FIPS
byte[] contents = System.IO.File.ReadAllBytes(file);
byte[] hashfile = sha256.ComputeHash(contents);
for (int i = 0; i < (sha256.HashSize / 8); i++)
Expand Down

0 comments on commit ebdffb9

Please sign in to comment.