aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/updater
diff options
context:
space:
mode:
Diffstat (limited to 'updater')
-rw-r--r--updater/downloader.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/updater/downloader.go b/updater/downloader.go
index ea3ee9d4..c1ca4beb 100644
--- a/updater/downloader.go
+++ b/updater/downloader.go
@@ -160,13 +160,21 @@ func DownloadVerifyAndExecute() (progress chan DownloadProgress) {
}
out.Close()
out = nil
+
+ progress <- DownloadProgress{Activity: "Verifying authenticode signature"}
+ if !version.IsOfficialPath(unverifiedDestinationFilename) {
+ os.Remove(unverifiedDestinationFilename)
+ progress <- DownloadProgress{Error: errors.New("The downloaded update does not have an authentic authenticode signature")}
+ return
+ }
+
+ progress <- DownloadProgress{Activity: "Installing update"}
err = os.Rename(unverifiedDestinationFilename, destinationFilename)
if err != nil {
os.Remove(unverifiedDestinationFilename)
progress <- DownloadProgress{Error: err}
return
}
- progress <- DownloadProgress{Activity: "Installing update"}
err = runMsi(destinationFilename)
os.Remove(unverifiedDestinationFilename)
if err != nil {