Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2017-09-20 10:58:43 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2017-09-20 10:58:43 +0300
commit6d401fbd8df2d150a5e1a259b1fb82e1033cf7a8 (patch)
treef902bbf4b8471c2f08d4c2769ba81c7dfe601024 /Duplicati/Library/Main/BackendManager.cs
parentea4cb50dd646465d4b5624c5916ad801fd801d71 (diff)
Changed all hash algorithms to use the `Cng` version.
This fixes #2621
Diffstat (limited to 'Duplicati/Library/Main/BackendManager.cs')
-rw-r--r--Duplicati/Library/Main/BackendManager.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Duplicati/Library/Main/BackendManager.cs b/Duplicati/Library/Main/BackendManager.cs
index 19065964d..8e56ac660 100644
--- a/Duplicati/Library/Main/BackendManager.cs
+++ b/Duplicati/Library/Main/BackendManager.cs
@@ -451,14 +451,14 @@ namespace Duplicati.Library.Main
public static string CalculateFileHash(string filename)
{
using (System.IO.FileStream fs = System.IO.File.OpenRead(filename))
- using (var hasher = System.Security.Cryptography.HashAlgorithm.Create(VOLUME_HASH))
+ using (var hasher = HashAlgorithmHelper.Create(VOLUME_HASH))
return Convert.ToBase64String(hasher.ComputeHash(fs));
}
/// <summary> Calculate file hash directly on stream object (for piping) </summary>
public static string CalculateFileHash(System.IO.Stream stream)
{
- using (var hasher = System.Security.Cryptography.HashAlgorithm.Create(VOLUME_HASH))
+ using (var hasher = HashAlgorithmHelper.Create(VOLUME_HASH))
return Convert.ToBase64String(hasher.ComputeHash(stream));
}
@@ -469,7 +469,7 @@ namespace Duplicati.Library.Main
public static System.Security.Cryptography.CryptoStream GetFileHasherStream
(System.IO.Stream stream, System.Security.Cryptography.CryptoStreamMode mode, out Func<string> getHash)
{
- var hasher = System.Security.Cryptography.HashAlgorithm.Create(VOLUME_HASH);
+ var hasher = HashAlgorithmHelper.Create(VOLUME_HASH);
System.Security.Cryptography.CryptoStream retHasherStream =
new System.Security.Cryptography.CryptoStream(stream, hasher, mode);
getHash = () =>
@@ -678,7 +678,7 @@ namespace Duplicati.Library.Main
IndexVolumeWriter wr = null;
try
{
- var hashsize = System.Security.Cryptography.HashAlgorithm.Create(m_options.BlockHashAlgorithm).HashSize / 8;
+ var hashsize = HashAlgorithmHelper.Create(m_options.BlockHashAlgorithm).HashSize / 8;
wr = new IndexVolumeWriter(m_options);
using(var rd = new IndexVolumeReader(p.CompressionModule, item.Indexfile.Item2.LocalFilename, m_options, hashsize))
wr.CopyFrom(rd, x => x == oldname ? newname : x);