From f11a14974cec70f1838ecbeded94267441f7816c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bere=C5=BCa=C5=84ski?= Date: Fri, 1 Dec 2017 21:52:09 +0100 Subject: [PATCH] chocolatey-visualstudio.extension: verify manifest checksum during download, if known GitHub-Issue: GH-7 GH-8 GH-10 GH-26 --- .../extensions/Get-VSComponentManifest.ps1 | 3 +-- .../extensions/Get-VSManifest.ps1 | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chocolatey-visualstudio.extension/extensions/Get-VSComponentManifest.ps1 b/chocolatey-visualstudio.extension/extensions/Get-VSComponentManifest.ps1 index 7c973876..9865c431 100644 --- a/chocolatey-visualstudio.extension/extensions/Get-VSComponentManifest.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Get-VSComponentManifest.ps1 @@ -25,8 +25,7 @@ function Get-VSComponentManifest return $null } - # TODO: pass -Checksum and -ChecksumType - $catalogManifest = Get-VSManifest -Description 'catalog manifest' -Url $url -LayoutFileName 'Catalog.json' -LayoutPath $layoutPath + $catalogManifest = Get-VSManifest -Description 'catalog manifest' -Url $url -Checksum $checksum -ChecksumType $checksumType -LayoutFileName 'Catalog.json' -LayoutPath $layoutPath return $catalogManifest } diff --git a/chocolatey-visualstudio.extension/extensions/Get-VSManifest.ps1 b/chocolatey-visualstudio.extension/extensions/Get-VSManifest.ps1 index 8724157d..1a789af1 100644 --- a/chocolatey-visualstudio.extension/extensions/Get-VSManifest.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Get-VSManifest.ps1 @@ -5,6 +5,8 @@ function Get-VSManifest ( [Parameter(Mandatory = $true)] [string] $Description, [Parameter(Mandatory = $true)] [string] $Url, + [string] $Checksum, + [string] $ChecksumType, [string] $LayoutFileName, [string] $LayoutPath ) @@ -52,6 +54,8 @@ function Get-VSManifest packageName = $Description fileFullPath = $localFilePath url = $Url + checksum = $Checksum + checksumType = $ChecksumType } Set-StrictMode -Off