From 2bfafe4b0dcdbe3c19e8f87338b437293c8ecc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Ani=C4=87=20Bani=C4=87?= Date: Wed, 23 May 2018 21:36:47 +0200 Subject: [PATCH] Add SHA256 hash verification Amended 3 times because of my stupidity... --- appveyor.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fbfd8f907d..a7cf9122ea 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,7 @@ environment: VULKAN_SDK: "C:\\VulkanSDK\\1.1.73.0" VULKAN_SDK_URL: https://sdk.lunarg.com/sdk/download/1.1.73.0/windows/VulkanSDK-1.1.73.0-Installer.exe VULKAN_SDK_MIRROR: https://obk.ee/rpcs3/VulkanSDK-1.1.73.0-Installer.exe + VULKAN_SDK_SHA: a5d193f97db4de97e6b4fdd81f00ff6a603f66bb17dc3cf8ac0fe9aec58497c7 cache: - glslang.7z -> appveyor.yml @@ -66,26 +67,28 @@ build: verbosity: normal before_build: -- ps: | # fetch precompiled build dependencies +- ps: | # initialize mirror arrays and fetch precompiled build dependencies + $VULKAN_SDK_URLS = @( + $env:VULKAN_SDK_MIRROR; + $env:VULKAN_SDK_URL; + "$($env:VULKAN_SDK_URL)?Human=true"; + ) if (!(test-path llvmlibs.7z)) { irm $env:LLVMLIBS -outfile llvmlibs.7z } if (!(test-path glslang.7z)) { irm $env:GLSLANG -outfile glslang.7z } 7z x llvmlibs.7z -aos -o"." | out-null 7z x glslang.7z -aos -o".\lib\$env:CONFIGURATION-$env:PLATFORM" | out-null if (!(test-path vulkan-sdk.exe)) - { - Try - { - irm $env:VULKAN_SDK_MIRROR -outfile vulkan-sdk.exe - } - Catch - { - Try + { + foreach ($url in $VULKAN_SDK_URLS) { + irm $url -outfile vulkan-sdk.exe + if ($env:VULKAN_SDK_SHA -eq $(Get-FileHash .\vulkan-sdk.exe).Hash) { - irm $env:VULKAN_SDK_URL -outfile vulkan-sdk.exe + echo "Successfully downloaded and verified vulkan-sdk.exe!" + break } - Catch + else { - irm "$($env:VULKAN_SDK_URL)?Human=true" -outfile vulkan-sdk.exe + echo "Invalid file hash, Vulkan SDK Setup was possibly tampered with, retrying with a different mirror..." } } }