From 0970997ab7b21b214c102db0f3076b787e71b4a8 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 25 Feb 2020 09:59:52 +0100 Subject: [PATCH] Publish updates to the new catalog file and switch to SHA-256 (phase 2) Version 2.4 switched to the catalog-0001.xml file. The new catalog file is using SHA-256 hashes and signatures. Signed-off-by: Simon Rozman --- Makefile | 11 +++-------- Updater | 2 +- include/UpdaterCfg.h | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8445d3b..1f8c90d 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ # OUTPUT_DIR=output -PUBLISH_DIR_LEGACY=\\amebis.doma\Splet\WWW\Apache2\www.amebis.si-prenos\ZRCola PUBLISH_DIR=\\amebis.doma\Splet\WWW\IIS-ext\prenos.amebis.si\ZRCola !IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" @@ -96,13 +95,11 @@ All :: \ PublishPre :: \ "$(PUBLISH_PACKAGE_DIR)" \ - "$(PUBLISH_DIR_LEGACY)" \ "$(PUBLISH_DIR)" Publish :: \ PublishPre \ - "$(PUBLISH_DIR_LEGACY)\catalog-0000.xml" \ - "$(PUBLISH_DIR)\catalog-0000.xml" + "$(PUBLISH_DIR)\catalog-0001.xml" ###################################################################### @@ -176,7 +173,6 @@ UnregisterShortcuts :: "$(OUTPUT_DIR)" \ "$(OUTPUT_DIR)\Keys" \ "$(OUTPUT_DIR)\locale" \ -"$(PUBLISH_DIR_LEGACY)" \ "$(PUBLISH_DIR)" \ "$(PUBLISH_PACKAGE_DIR)" \ "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" : @@ -217,8 +213,7 @@ UnregisterShortcuts :: # Building ###################################################################### -"$(PUBLISH_DIR_LEGACY)\catalog-0000.xml" \ -"$(PUBLISH_DIR)\catalog-0000.xml" : "$(OUTPUT_DIR)\catalog.xml" +"$(PUBLISH_DIR)\catalog-0001.xml" : "$(OUTPUT_DIR)\catalog.xml" copy /y $** $@ > NUL "$(OUTPUT_DIR)\catalog.xml" : \ @@ -229,7 +224,7 @@ UnregisterShortcuts :: "$(OUTPUT_DIR)\ZRColaSl32.msi" \ "$(OUTPUT_DIR)\ZRColaSl64.msi" -if exist $@ del /f /q $@ - copy /y "$(PUBLISH_DIR)\catalog-0000.xml" "$(@:"=).tmp" > NUL + copy /y "$(PUBLISH_DIR)\catalog-0001.xml" "$(@:"=).tmp" > NUL "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.msi" "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.msi" "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu32.msi" -f "$(OUTPUT_DIR)\ZRColaRu32.msi" diff --git a/Updater b/Updater index e761794..8baf612 160000 --- a/Updater +++ b/Updater @@ -1 +1 @@ -Subproject commit e7617949b35b875292e5333cf11dfe024bf8212d +Subproject commit 8baf612a6ca9eb6955912f208776929413bd5b79 diff --git a/include/UpdaterCfg.h b/include/UpdaterCfg.h index 6c0f6d0..3ca659a 100644 --- a/include/UpdaterCfg.h +++ b/include/UpdaterCfg.h @@ -15,3 +15,21 @@ // Update server catalog location // #define UPDATER_HTTP_PATH "/ZRCola/catalog-0001.xml" + +// +// Hash for publishing packages and signing catalog +// +#define wxUpdaterHashGen wxCryptoHashSHA256 + +// +// Hash for verifying catalog signature and packages +// +#define wxUpdaterHashChk wxCryptoHashSHA256 + +// +// When changing the hash algorithm: +// +// 1. Bump UPDATER_HTTP_PATH and set wxUpdaterHashChk to new hash class. +// 2. Publish the updated product using the old catalog and old wxUpdaterHashGen hash. +// 3. Set wxUpdaterHashGen to new hash class, update Makefile to publish future updates to the new catalog. +//