mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
Actually be smarter
This commit is contained in:
parent
1456efc341
commit
14bab623b8
1 changed files with 11 additions and 3 deletions
|
@ -166,6 +166,12 @@ namespace ArchiSteamFarm.Helpers {
|
|||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
if (!HasDefaultCryptKey) {
|
||||
ASF.ArchiLogger.LogGenericError(Strings.ErrorAborted);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Utilities.InBackground(
|
||||
() => {
|
||||
(bool isWeak, string? reason) = Utilities.TestPasswordStrength(key, ForbiddenCryptKeyPhrases);
|
||||
|
@ -176,12 +182,14 @@ namespace ArchiSteamFarm.Helpers {
|
|||
}
|
||||
);
|
||||
|
||||
EncryptionKey = Encoding.UTF8.GetBytes(key);
|
||||
HasDefaultCryptKey = false;
|
||||
byte[] encryptionKey = Encoding.UTF8.GetBytes(key);
|
||||
|
||||
if (EncryptionKey.Length < MinimumRecommendedCryptKeyBytes) {
|
||||
if (encryptionKey.Length < MinimumRecommendedCryptKeyBytes) {
|
||||
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningTooShortCryptKey, MinimumRecommendedCryptKeyBytes));
|
||||
}
|
||||
|
||||
HasDefaultCryptKey = encryptionKey.SequenceEqual(EncryptionKey);
|
||||
EncryptionKey = encryptionKey;
|
||||
}
|
||||
|
||||
private static string? DecryptAES(string encryptedString) {
|
||||
|
|
Loading…
Reference in a new issue