aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Updates
diff options
context:
space:
mode:
authorStepan Goremykin <goremukin@gmail.com>2023-10-14 00:45:52 +0200
committerStepan Goremykin <goremukin@gmail.com>2023-10-14 00:45:52 +0200
commit38d962242ad0b4d3cf10b175836bf1e5e9b60d39 (patch)
treeaa0c164036ea9e628f38fa14a3d29635f7ffd042 /Emby.Server.Implementations/Updates
parenta773b43a814e6e849bbb5eb0fa1bccf09a4c1945 (diff)
parent4fc27fa63eb5a88a1a67a7ba67e969468f79a48d (diff)
Merge branch 'master' into fix-resharper-warnings
# Conflicts: # Emby.Server.Implementations/Updates/InstallationManager.cs # tests/Jellyfin.Server.Integration.Tests/OpenApiSpecTests.cs
Diffstat (limited to 'Emby.Server.Implementations/Updates')
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 3b4ecc962..c717744b1 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -520,18 +520,16 @@ namespace Emby.Server.Implementations.Updates
// CA5351: Do Not Use Broken Cryptographic Algorithms
#pragma warning disable CA5351
- using var md5 = MD5.Create();
cancellationToken.ThrowIfCancellationRequested();
- var hash = await md5.ComputeHashAsync(stream, cancellationToken).ConfigureAwait(false);
- var hashHex = Convert.ToHexString(hash);
- if (!string.Equals(package.Checksum, hashHex, StringComparison.OrdinalIgnoreCase))
+ var hash = Convert.ToHexString(await MD5.HashDataAsync(stream, cancellationToken).ConfigureAwait(false));
+ if (!string.Equals(package.Checksum, hash, StringComparison.OrdinalIgnoreCase))
{
_logger.LogError(
"The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}",
package.Name,
package.Checksum,
- hashHex);
+ hash);
throw new InvalidDataException("The checksum of the received data doesn't match.");
}
@@ -557,7 +555,7 @@ namespace Emby.Server.Implementations.Updates
reader.ExtractToDirectory(targetDir, true);
// Ensure we create one or populate existing ones with missing data.
- await _pluginManager.PopulateManifest(package.PackageInfo, package.Version, targetDir, status);
+ await _pluginManager.PopulateManifest(package.PackageInfo, package.Version, targetDir, status).ConfigureAwait(false);
_pluginManager.ImportPluginFrom(targetDir);
}