diff options
author | Jamie Mansfield <jmansfield@cadixdev.org> | 2021-06-28 22:09:52 +0100 |
---|---|---|
committer | Jamie Mansfield <jmansfield@cadixdev.org> | 2021-06-28 22:09:52 +0100 |
commit | f51efc9109c3bddd8dd83737f5600cfcef57a6f6 (patch) | |
tree | c8a9157165cd09287b2e0dc5026b46848d0ec812 /api/logic/modplatform | |
parent | dc3a4cebce489b5d61081a315311ffa3d34992ef (diff) | |
download | PrismLauncher-f51efc9109c3bddd8dd83737f5600cfcef57a6f6.tar.gz PrismLauncher-f51efc9109c3bddd8dd83737f5600cfcef57a6f6.tar.bz2 PrismLauncher-f51efc9109c3bddd8dd83737f5600cfcef57a6f6.zip |
NOISSUE Verify file checksums for modpacks.ch
Diffstat (limited to 'api/logic/modplatform')
-rw-r--r-- | api/logic/modplatform/modpacksch/FTBPackInstallTask.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/logic/modplatform/modpacksch/FTBPackInstallTask.cpp b/api/logic/modplatform/modpacksch/FTBPackInstallTask.cpp index ddc7fe35..b3c97c7b 100644 --- a/api/logic/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/api/logic/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -5,6 +5,7 @@ #include "Json.h" #include "minecraft/MinecraftInstance.h" #include "minecraft/PackProfile.h" +#include "net/ChecksumValidator.h" #include "settings/INISettingsObject.h" namespace ModpacksCH { @@ -98,6 +99,10 @@ void PackInstallTask::downloadPack() qDebug() << "Will download" << file.url << "to" << path; auto dl = Net::Download::makeFile(file.url, path); + if (!file.sha1.isEmpty()) { + auto rawSha1 = QByteArray::fromHex(file.sha1.toLatin1()); + dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1)); + } jobPtr->addNetAction(dl); } |