Re: Allow encrypting data in FIT with binman

2024-08-05 Thread Paul HENRYS (EXT)
Hi Simon,

Sorry for the late reply as I missed your message blocked in quarantine.
It looks like when I push a patch with binary data, patchworks does not seem to 
get it right. Nonetheless, using git send-email, a copy is also sent to me and 
I do get the patch right.
I put you in CC this time so you should also have received a copy of the 
patches. Could you take a look you get the patch "[v2,3/3] tools: binman: Add 
tests for FIT with data encrypted by mkimage" with the binary data?

The end of the patch with the binary data should be as such:

diff --git a/tools/binman/test/aes256.bin b/tools/binman/test/aes256.bin
new file mode 100644
index 
..09b8bf6254ada5c084039f32916bc7d30233bb2c
GIT binary patch
literal 32
ncmXpsGBz
Sent: Monday, 1 July 2024 15:57
To: U-Boot Mailing List 
Cc: Paul HENRYS (EXT) 
Subject: Re: Allow encrypting data in FIT with binman


This Mail comes from Outside of SoftAtHome: Do not answer, click links or open 
attachments unless you recognize the sender and know the content is safe.

Hi Paul,

Unfortunately I did not receive the email with your patch but I see it
in patchwork here:

https://patchwork.ozlabs.org/bundle/sjg/dm/?series=408037

I get this error:

binman test testSimpleFitEncryptedData
 Running binman tests 
E
==
ERROR: testSimpleFitEncryptedData (binman.ftest.TestFunctional)
Test an image with a FIT containing data to be encrypted
--
ValueError: Error 1 running 'mkimage -t -k tools/binman/test -F
/tmp/binman.s_qv4_fc/fit.fit': File tools/binman/test/aes256.bin don't
have the expected size (size=0, expected=32)
mkimage Can't add hashes to FIT blob: -1
Error: Bad parameters for FIT image type
Usage: mkimage [-T type] -l image
...

The aes.bin file seems to be empty for me. Can you please check the patch?

Thank you for doing a proper test.  Can you also please update the
docs for Entry_fit to cover your new property, and regenerate
entries.rst ?

Note that there is a tools.readfile() helper which can read a binary/text file.

Regards,
Simon


Re: Allow encrypting data in FIT with binman

2024-07-01 Thread Simon Glass
Hi Paul,

Unfortunately I did not receive the email with your patch but I see it
in patchwork here:

https://patchwork.ozlabs.org/bundle/sjg/dm/?series=408037

I get this error:

binman test testSimpleFitEncryptedData
 Running binman tests 
E
==
ERROR: testSimpleFitEncryptedData (binman.ftest.TestFunctional)
Test an image with a FIT containing data to be encrypted
--
ValueError: Error 1 running 'mkimage -t -k tools/binman/test -F
/tmp/binman.s_qv4_fc/fit.fit': File tools/binman/test/aes256.bin don't
have the expected size (size=0, expected=32)
mkimage Can't add hashes to FIT blob: -1
Error: Bad parameters for FIT image type
Usage: mkimage [-T type] -l image
...

The aes.bin file seems to be empty for me. Can you please check the patch?

Thank you for doing a proper test.  Can you also please update the
docs for Entry_fit to cover your new property, and regenerate
entries.rst ?

Note that there is a tools.readfile() helper which can read a binary/text file.

Regards,
Simon