Skip to content
Snippets Groups Projects
Commit 46039882 authored by Nico Dechesne (Stage)'s avatar Nico Dechesne (Stage)
Browse files

signlk: do not hardcode the number of segment


The current scripts assume the ELF file to sign contains two segments. Instead,
generate the segment with a specific file name pattern and loop through all
files, without hardcoding any number.

Signed-off-by: default avatarNicolas Dechesne <nicolas.dechesne@linaro.org>
parent 750be284
No related branches found
No related tags found
No related merge requests found
......@@ -225,7 +225,7 @@ int main( int argc, char** argv )
const char * data=pseg->get_data();
if (data != NULL)
{
std::string tmpFileName = tmp_path+"/";
std::string tmpFileName = tmp_path+"/segment";
char index = i+hash_offset+'0';
tmpFileName.append(&index,1);
saveDataToFile(tmpFileName, pseg->get_data(), pseg->get_file_size());
......
......@@ -120,8 +120,10 @@ $EXECUTABLE $INFILE $TMPOUTFILE $tmpdir
openssl sha256 -binary $tmpdir/header > $tmpdir/data
cat $tmpdir/hash>> $tmpdir/data
openssl sha256 -binary $tmpdir/2 >> $tmpdir/data
openssl sha256 -binary $tmpdir/3 >> $tmpdir/data
for f in $tmpdir/segment*; do
openssl sha256 -binary $f >> $tmpdir/data
done
openssl sha256 -binary $tmpdir/data > $tmpdir/stp0
cat $tmpdir/Si > $tmpdir/tmpDigest0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment