secure boot: Fix bug where verification key was not embedded in app

This commit is contained in:
Angus Gratton
2019-10-29 12:46:09 +11:00
committed by Angus Gratton
parent 758db1e008
commit e8881352c5
3 changed files with 65 additions and 23 deletions

View File

@@ -38,9 +38,14 @@ string(REGEX REPLACE "[^\n]+$" ".byte \\0\n" data "${data}")
string(REGEX REPLACE "[0-9a-f][0-9a-f]" "0x\\0, " data "${data}") # hex formatted C bytes
string(REGEX REPLACE ", \n" "\n" data "${data}") # trim the last comma
## Come up with C-friendly symbol name based on source file
get_filename_component(source_filename "${DATA_FILE}" NAME)
string(MAKE_C_IDENTIFIER "${source_filename}" varname)
## Come up with C-friendly variable name based on source file
# unless VARIABLE_BASENAME is set
if(NOT VARIABLE_BASENAME)
get_filename_component(source_filename "${DATA_FILE}" NAME)
string(MAKE_C_IDENTIFIER "${source_filename}" varname)
else()
string(MAKE_C_IDENTIFIER "${VARIABLE_BASENAME}" varname)
endif()
function(append str)
file(APPEND "${SOURCE_FILE}" "${str}")