more CA fix

pull/456/head
Antoine Rybacki 2 years ago
parent 58182284b2
commit 5b4917eb29

@ -1163,7 +1163,7 @@ namespace DepotDownloader
neededChunks = Util.ValidateSteam3FileChecksums(fs, file.Chunks.OrderBy(x => x.Offset).ToArray()); neededChunks = Util.ValidateSteam3FileChecksums(fs, file.Chunks.OrderBy(x => x.Offset).ToArray());
} }
if (neededChunks.Count() == 0) if (neededChunks.Count == 0)
{ {
lock (depotDownloadCounter) lock (depotDownloadCounter)
{ {

@ -211,9 +211,9 @@ namespace DepotDownloader
}; };
var request = new SteamApps.PICSRequest(appId); var request = new SteamApps.PICSRequest(appId);
if (AppTokens.ContainsKey(appId)) if (AppTokens.TryGetValue(appId, out var value))
{ {
request.AccessToken = AppTokens[appId]; request.AccessToken = value;
} }
WaitUntilCallback(() => WaitUntilCallback(() =>
@ -656,7 +656,7 @@ namespace DepotDownloader
{ {
Console.Write("Please enter your 2 factor auth code from your authenticator app: "); Console.Write("Please enter your 2 factor auth code from your authenticator app: ");
logonDetails.TwoFactorCode = Console.ReadLine(); logonDetails.TwoFactorCode = Console.ReadLine();
} while (String.Empty == logonDetails.TwoFactorCode); } while (string.Empty == logonDetails.TwoFactorCode);
} }
else if (isAccessToken) else if (isAccessToken)
{ {

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -115,13 +115,10 @@ namespace DepotDownloader
public static byte[] SHAHash(byte[] input) public static byte[] SHAHash(byte[] input)
{ {
using (var sha = SHA1.Create()) var output = SHA1.HashData(input);
{
var output = sha.ComputeHash(input);
return output; return output;
} }
}
public static byte[] DecodeHexString(string hex) public static byte[] DecodeHexString(string hex)
{ {
@ -146,7 +143,7 @@ namespace DepotDownloader
public static async Task InvokeAsync(IEnumerable<Func<Task>> taskFactories, int maxDegreeOfParallelism) public static async Task InvokeAsync(IEnumerable<Func<Task>> taskFactories, int maxDegreeOfParallelism)
{ {
if (taskFactories == null) throw new ArgumentNullException(nameof(taskFactories)); ArgumentNullException.ThrowIfNull(taskFactories);
if (maxDegreeOfParallelism <= 0) throw new ArgumentException(nameof(maxDegreeOfParallelism)); if (maxDegreeOfParallelism <= 0) throw new ArgumentException(nameof(maxDegreeOfParallelism));
var queue = taskFactories.ToArray(); var queue = taskFactories.ToArray();

Loading…
Cancel
Save