Skip to content

Commit

Permalink
Remove update-key.cmake
Browse files Browse the repository at this point in the history
This is not necessary anymore, now picotool writes the AES key to otp json files

Fixes #613
  • Loading branch information
will-v-pi committed Feb 24, 2025
1 parent f5a32ed commit a037c89
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 332 deletions.
6 changes: 1 addition & 5 deletions bootloaders/encrypted/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ add_executable(enc_bootloader
aes.S
)

# Add command to update otp.json if privateaes.bin changes
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/otp.json
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/update-key.cmake"
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/privateaes.bin)
# Copy that otp.json file to build directory
# Copy otp.json file to build directory
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otp.json
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/otp.json" "${CMAKE_CURRENT_BINARY_DIR}/otp.json"
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/otp.json)
Expand Down
139 changes: 1 addition & 138 deletions bootloaders/encrypted/otp.json
Original file line number Diff line number Diff line change
@@ -1,142 +1,5 @@
{
"30:0" :
{
"ecc" : true,
"value" :
[
"0x31",
"0xb6",
"0xd8",
"0x18",
"0x23",
"0x2e",
"0x7b",
"0x7c",
"0xa3",
"0xb1",
"0xb7",
"0x90",
"0x7b",
"0x2f",
"0x41",
"0xd2",
"0x51",
"0xb5",
"0x03",
"0x62",
"0xd6",
"0x21",
"0x0c",
"0xb5",
"0x8d",
"0x17",
"0xe6",
"0xd5",
"0x6b",
"0x0d",
"0x87",
"0x8d",
"0x2b",
"0x74",
"0xa4",
"0xba",
"0xb9",
"0x14",
"0x75",
"0x88",
"0x9b",
"0x05",
"0x2d",
"0x32",
"0x51",
"0xc1",
"0x35",
"0x09",
"0x78",
"0xbb",
"0x6d",
"0xc2",
"0xbb",
"0xa6",
"0x5e",
"0x95",
"0xa2",
"0x29",
"0x32",
"0x34",
"0x5b",
"0x2c",
"0xd3",
"0xf8",
"0x5d",
"0xe2",
"0x5f",
"0x23",
"0xeb",
"0x27",
"0xa4",
"0xcd",
"0xb0",
"0x8e",
"0xf4",
"0x6e",
"0x94",
"0x86",
"0x19",
"0x93",
"0x3a",
"0xd8",
"0x97",
"0x65",
"0x29",
"0x25",
"0x57",
"0x65",
"0x49",
"0x03",
"0xfe",
"0xc6",
"0xe9",
"0x8b",
"0xa3",
"0x7e",
"0x2b",
"0x53",
"0x80",
"0x68",
"0xdd",
"0x05",
"0x10",
"0x17",
"0xca",
"0xc3",
"0xa8",
"0x04",
"0x8d",
"0x12",
"0xaf",
"0xd9",
"0x49",
"0xa9",
"0x6d",
"0x90",
"0x7c",
"0xb3",
"0x63",
"0x4f",
"0x36",
"0xc5",
"0x00",
"0xb5",
"0x71",
"0x74",
"0xe6",
"0x9a"
]
},
"OTP_DATA_KEY1" : [ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 ],
"OTP_DATA_KEY1_VALID" : "0x010101",
"OTP_DATA_KEY2" : [ 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0 ],
"OTP_DATA_KEY2_VALID" : "0x010101",
"PAGE30_LOCK0" : "0x4a4a4a"
"PAGE30_LOCK0" : "0x494949"
}
23 changes: 0 additions & 23 deletions bootloaders/encrypted/update-key.cmake

This file was deleted.

6 changes: 1 addition & 5 deletions encrypted/hello_encrypted/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ pico_set_binary_version(hello_encrypted MAJOR 7 MINOR 3)
# set tbyb (optional)
# target_compile_definitions(hello_encrypted PRIVATE PICO_CRT0_IMAGE_TYPE_TBYB=1)

# Add command to update otp.json if privateaes.bin changes
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/otp.json
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/update-key.cmake"
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/privateaes.bin)
# Copy that otp.json file to build directory
# Copy otp.json file to build directory
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otp.json
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/otp.json" "${CMAKE_CURRENT_BINARY_DIR}/otp.json"
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/otp.json)
Expand Down
140 changes: 2 additions & 138 deletions encrypted/hello_encrypted/otp.json
Original file line number Diff line number Diff line change
@@ -1,141 +1,5 @@
{
"29:0" :
{
"ecc" : true,
"value" :
[
"0x31",
"0xb6",
"0xd8",
"0x18",
"0x23",
"0x2e",
"0x7b",
"0x7c",
"0xa3",
"0xb1",
"0xb7",
"0x90",
"0x7b",
"0x2f",
"0x41",
"0xd2",
"0x51",
"0xb5",
"0x03",
"0x62",
"0xd6",
"0x21",
"0x0c",
"0xb5",
"0x8d",
"0x17",
"0xe6",
"0xd5",
"0x6b",
"0x0d",
"0x87",
"0x8d",
"0x2b",
"0x74",
"0xa4",
"0xba",
"0xb9",
"0x14",
"0x75",
"0x88",
"0x9b",
"0x05",
"0x2d",
"0x32",
"0x51",
"0xc1",
"0x35",
"0x09",
"0x78",
"0xbb",
"0x6d",
"0xc2",
"0xbb",
"0xa6",
"0x5e",
"0x95",
"0xa2",
"0x29",
"0x32",
"0x34",
"0x5b",
"0x2c",
"0xd3",
"0xf8",
"0x5d",
"0xe2",
"0x5f",
"0x23",
"0xeb",
"0x27",
"0xa4",
"0xcd",
"0xb0",
"0x8e",
"0xf4",
"0x6e",
"0x94",
"0x86",
"0x19",
"0x93",
"0x3a",
"0xd8",
"0x97",
"0x65",
"0x29",
"0x25",
"0x57",
"0x65",
"0x49",
"0x03",
"0xfe",
"0xc6",
"0xe9",
"0x8b",
"0xa3",
"0x7e",
"0x2b",
"0x53",
"0x80",
"0x68",
"0xdd",
"0x05",
"0x10",
"0x17",
"0xca",
"0xc3",
"0xa8",
"0x04",
"0x8d",
"0x12",
"0xaf",
"0xd9",
"0x49",
"0xa9",
"0x6d",
"0x90",
"0x7c",
"0xb3",
"0x63",
"0x4f",
"0x36",
"0xc5",
"0x00",
"0xb5",
"0x71",
"0x74",
"0xe6",
"0x9a"
]
},
"OTP_DATA_KEY1" : [ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 ],
"OTP_DATA_KEY1_VALID" : "0x010101",
"PAGE29_LOCK0" : "0x494949",
"PAGE29_LOCK1" : "0x3d3d3d"
}
"PAGE29_LOCK0" : "0x494949"
}
23 changes: 0 additions & 23 deletions encrypted/hello_encrypted/update-key.cmake

This file was deleted.

0 comments on commit a037c89

Please sign in to comment.