Skip to content

Commit

Permalink
Choose FIPS compliant implementation of the SHA1 algorithm
Browse files Browse the repository at this point in the history
(cherry picked from commit f4257c9)
  • Loading branch information
SteveGilham committed Mar 23, 2024
1 parent 2a2f683 commit b50ff4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Mono.Security.Cryptography/CryptoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static byte [] HashStream (Stream stream, ImageWriter writer, out int strong_nam
+ (strong_name_directory.VirtualAddress - text.VirtualAddress));
var strong_name_length = (int) strong_name_directory.Size;

var sha1 = new SHA1Managed ();
var sha1 = new SHA1CryptoServiceProvider ();
var buffer = new byte [buffer_size];
using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) {
stream.Seek (0, SeekOrigin.Begin);
Expand Down Expand Up @@ -131,7 +131,7 @@ public static byte [] ComputeHash (Stream stream)
{
const int buffer_size = 8192;

var sha1 = new SHA1Managed ();
var sha1 = new SHA1CryptoServiceProvider ();
var buffer = new byte [buffer_size];

using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write))
Expand All @@ -142,7 +142,7 @@ public static byte [] ComputeHash (Stream stream)

public static byte [] ComputeHash (params ByteBuffer [] buffers)
{
var sha1 = new SHA1Managed ();
var sha1 = new SHA1CryptoServiceProvider ();

using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) {
for (int i = 0; i < buffers.Length; i++) {
Expand Down

0 comments on commit b50ff4e

Please sign in to comment.