From 46495773c213359200e4294ddcac828a4887e5a9 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 5 Oct 2022 19:16:05 +0200 Subject: [PATCH] Move keypair source out of source folder This allows us to use `git clean` without risking to loose keypair, since it is typically .gitignored and not included in the Git repository. Signed-off-by: Simon Rozman --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 49d7adb..c41dab3 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ Clean :: # Folder creation ###################################################################### +"$(APPDATA)\Updater" \ "$(KEY_DIR)" : if not exist $@ md $@ @@ -28,20 +29,21 @@ Clean :: ###################################################################### GenRSAKeypair :: \ + "$(APPDATA)\Updater" \ "$(KEY_DIR)" \ "$(KEY_DIR)\UpdaterKeyPrivate.bin" \ "$(KEY_DIR)\UpdaterKeyPublic.bin" -"$(KEY_DIR)\UpdaterKeypair.txt" : +"$(APPDATA)\Updater\Keypair.txt" : openssl.exe genrsa -out $@ 4096 -"$(KEY_DIR)\UpdaterKeyPrivate.bin" : "$(KEY_DIR)\UpdaterKeypair.txt" +"$(KEY_DIR)\UpdaterKeyPrivate.bin" : "$(APPDATA)\Updater\Keypair.txt" if exist $@ del /f /q $@ if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp" openssl.exe rsa -in $** -inform PEM -outform DER -out "$(@:"=).tmp" move /y "$(@:"=).tmp" $@ > NUL -"$(KEY_DIR)\UpdaterKeyPublic.bin" : "$(KEY_DIR)\UpdaterKeypair.txt" +"$(KEY_DIR)\UpdaterKeyPublic.bin" : "$(APPDATA)\Updater\Keypair.txt" if exist $@ del /f /q $@ if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp" openssl.exe rsa -in $** -inform PEM -outform DER -out "$(@:"=).tmp" -pubout