Re: [cbootimage PATCH V2] crypto: produce consistent hash for zero-length data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 26, 2013 at 04:12:50PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@xxxxxxxxxx>
> 
> In real-world use-cases, hashing zero-length data likely never happens.
> However, it is relevant when testing cbootimage with a dummy zero-length
> bootloader binary, e.g.:
> 
> touch u-boot.bin
> cbootimage -t30 ../tamonten-ng/tegra30.img.cfg tegra30-tec-ng.img
> 
> In this scenario, it's useful to create a consistent hash, so that one
> can compare the resultant images before and after applying patches, to
> check for regressions.
> 
> Hence, zero out the hash data so it has consistent content if it isn't
> written to.
> 
> Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
> ---
> v2: clear region using calloc at allocation time, rather than memset
>     at hash-calculation time.
> ---
>  src/crypto.c      | 2 +-
>  src/data_layout.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Looks good:

Reviewed-by: Thierry Reding <treding@xxxxxxxxxx>

Attachment: pgpdKfA_6XrTt.pgp
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux