diff options
author | Alexandru Gagniuc <mr.nuke.me@gmail.com> | 2021-09-14 23:53:33 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-15 01:44:02 +0300 |
commit | 1ac7580a225408a46eecb9046ad5f38d7ea4a520 (patch) | |
tree | 54006b6a9d63171e0fc61a1d243f7cc597f75c21 /configs/malta64_defconfig | |
parent | c6eac9122f022424f274dede255c793523c25953 (diff) | |
download | u-boot-1ac7580a225408a46eecb9046ad5f38d7ea4a520.tar.xz |
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>
Diffstat (limited to 'configs/malta64_defconfig')
0 files changed, 0 insertions, 0 deletions