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 <simon@rozman.si>
This commit is contained in:
Simon Rozman 2022-10-05 19:16:05 +02:00
parent 76124075fc
commit 46495773c2

View File

@ -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