From 4f7b601e2c4f1c58040b7013bbe7c2a470b75417 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 3 May 2023 22:56:24 +0300 Subject: [PATCH 1/2] Remove support for encrypted_gid (v1) --- DepotDownloader/ContentDownloader.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 18e19bbe..92171dce 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -255,23 +255,8 @@ namespace DepotDownloader Config.BetaPassword = password = Console.ReadLine(); } - var encrypted_v1 = node_encrypted["encrypted_gid"]; var encrypted_v2 = node_encrypted["encrypted_gid_2"]; - if (encrypted_v1 != KeyValue.Invalid) - { - var input = Util.DecodeHexString(encrypted_v1.Value); - var manifest_bytes = CryptoHelper.VerifyAndDecryptPassword(input, password); - - if (manifest_bytes == null) - { - Console.WriteLine("Password was invalid for branch {0}", branch); - return INVALID_MANIFEST_ID; - } - - return BitConverter.ToUInt64(manifest_bytes, 0); - } - if (encrypted_v2 != KeyValue.Invalid) { // Submit the password to Steam now to get encryption keys From 2cfee72f69a702a883e9db7cc3a529e73c10d981 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 3 May 2023 22:57:09 +0300 Subject: [PATCH 2/2] Support new `gid` field in encrypted manifests --- DepotDownloader/ContentDownloader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 92171dce..19de60ba 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -255,9 +255,14 @@ namespace DepotDownloader Config.BetaPassword = password = Console.ReadLine(); } - var encrypted_v2 = node_encrypted["encrypted_gid_2"]; + var encrypted_gid = node_encrypted["gid"]; - if (encrypted_v2 != KeyValue.Invalid) + if (encrypted_gid == KeyValue.Invalid) + { + encrypted_gid = node_encrypted["encrypted_gid_2"]; + } + + if (encrypted_gid != KeyValue.Invalid) { // Submit the password to Steam now to get encryption keys steam3.CheckAppBetaPassword(appId, Config.BetaPassword); @@ -268,7 +273,7 @@ namespace DepotDownloader return INVALID_MANIFEST_ID; } - var input = Util.DecodeHexString(encrypted_v2.Value); + var input = Util.DecodeHexString(encrypted_gid.Value); byte[] manifest_bytes; try {