Skip to content

Commit f9e6f69

Browse files
committed
Update scripts
1 parent 3fb17a5 commit f9e6f69

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Scripts/make_keys.bat renamed to Scripts/make_keys_v6m.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22

3-
echo %0 : Generate new secure keys for stm32-secure-patching-bootloader
3+
echo %0 : Generate new secure keys for stm32-secure-patching-bootloader and Cortex-M0 (V6M) architecture devices
44

55
set _KEY_TOOL=..\Tools\prepareimage.py
66
set _OUTPUT_DIR=%1
@@ -18,10 +18,14 @@ if NOT EXIST %_KEY_TOOL% (
1818

1919
set _CIPHER_KEY=Cipher_Key_AES_CBC.bin
2020
set _SIGNING_KEY=Signing_PrivKey_ECC.txt
21+
set _MACHINE_FILE=machine.txt
2122

2223
echo Making %_OUTPUT_DIR%/%_CIPHER_KEY%
2324
python %_KEY_TOOL% keygen -k %_OUTPUT_DIR%\%_CIPHER_KEY% -t aes-cbc
2425

2526
echo Making %_OUTPUT_DIR%/%_SIGNING_KEY%
2627
python %_KEY_TOOL% keygen -k %_OUTPUT_DIR%\%_SIGNING_KEY% -t ecdsa-p256
2728

29+
echo Making %_OUTPUT_DIR%/%_MACHINE_FILE%
30+
echo V6M > %_OUTPUT_DIR%/%_MACHINE_FILE%
31+

Scripts/make_keys_v7m.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
3+
echo %0 : Generate new secure keys for stm32-secure-patching-bootloader and Cortex-M3/M4/M7 (V7M and later) architecture devices
4+
5+
set _KEY_TOOL=..\Tools\prepareimage.py
6+
set _OUTPUT_DIR=%1
7+
8+
if [%_OUTPUT_DIR%]==[] (
9+
echo Please specify destination path to application Keys directory
10+
goto:eof
11+
)
12+
13+
if NOT EXIST %_KEY_TOOL% (
14+
echo Key generation tool is not found %_KEY_TOOL%
15+
goto:eof
16+
)
17+
18+
19+
set _CIPHER_KEY=Cipher_Key_AES_CBC.bin
20+
set _SIGNING_KEY=Signing_PrivKey_ECC.txt
21+
set _MACHINE_FILE=machine.txt
22+
23+
echo Making %_OUTPUT_DIR%/%_CIPHER_KEY%
24+
python %_KEY_TOOL% keygen -k %_OUTPUT_DIR%\%_CIPHER_KEY% -t aes-cbc
25+
26+
echo Making %_OUTPUT_DIR%/%_SIGNING_KEY%
27+
python %_KEY_TOOL% keygen -k %_OUTPUT_DIR%\%_SIGNING_KEY% -t ecdsa-p256
28+
29+
echo Making %_OUTPUT_DIR%/%_MACHINE_FILE%
30+
echo V7M > %_OUTPUT_DIR%/%_MACHINE_FILE%
31+

0 commit comments

Comments
 (0)