Alexandru Gagniuc 1ac7580a22 image: Avoid erroneous double byte-swap in CRC value
The hash algorithm selection was streamlined in commit 92055e138f28
("image: Drop if/elseif hash selection in calculate_hash()"). Said
commit kept the call to cpu_to_uimage() to convert the CRC to big
endian format.

This would have been correct when calling crc32_wd(). However, the
->hash_func_ws member of crc32 points to crc32_wd_buf(), which already
converts the CRC to big endian. On a little endian host, doing both
conversions results in a little-endian CRC. This is incorrect.

To remedy this, simply drop the call to cpu_to_uimage(), thus only
doing the byte-order conversion once.

Fixes: 92055e138f28 ("image: Drop if/elseif hash selection in
       calculate_hash()")
Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-09-14 18:44:02 -04:00
..
2021-07-23 13:36:20 -04:00
2020-05-18 21:19:18 -04:00
2021-09-13 18:23:13 -04:00
2021-06-08 11:39:09 -04:00
2021-04-12 17:44:55 -04:00
2021-04-20 07:31:12 -04:00
2021-01-06 07:57:33 -05:00
2020-10-22 09:54:53 -04:00