|
|
@ -524,14 +524,15 @@ namespace Emby.Server.Implementations.Updates
|
|
|
|
using var md5 = MD5.Create();
|
|
|
|
using var md5 = MD5.Create();
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
|
|
|
|
|
|
|
var hash = Convert.ToHexString(md5.ComputeHash(stream));
|
|
|
|
var hash = await md5.ComputeHashAsync(stream, cancellationToken).ConfigureAwait(false);
|
|
|
|
if (!string.Equals(package.Checksum, hash, StringComparison.OrdinalIgnoreCase))
|
|
|
|
var hashHex = Convert.ToHexString(hash);
|
|
|
|
|
|
|
|
if (!string.Equals(package.Checksum, hashHex, StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogError(
|
|
|
|
_logger.LogError(
|
|
|
|
"The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}",
|
|
|
|
"The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}",
|
|
|
|
package.Name,
|
|
|
|
package.Name,
|
|
|
|
package.Checksum,
|
|
|
|
package.Checksum,
|
|
|
|
hash);
|
|
|
|
hashHex);
|
|
|
|
throw new InvalidDataException("The checksum of the received data doesn't match.");
|
|
|
|
throw new InvalidDataException("The checksum of the received data doesn't match.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|