Skip to contentSkip to conversation

commit 3ef46a9 "Fix hash verification" breaks crc32 verify

U-Boot Marcel Ziswiler 1 participant 1 message May 5, 2015

lore
Share & tools
lore

Marcel Ziswiler

author Reviewed-by Simon Glass
#0 lore raw

U-Boot SPL 2015.04-00631-gace97d2 (May 05 2015 - 13:32:44)

U-Boot 2015.04-00631-gace97d2 (May 05 2015 - 13:32:44)

TEGRA30

Model: Toradex Colibri T30
DRAM:  1 GiB
iC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1
In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped

No ethernet found.
Hit any key to stop autoboot: 0
Colibri T30 # crc32 0x80000000 0x100
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca
Colibri T30 # crc32 -v 0x80000000 0x100 c9a057b3
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != ffffffff ** ERROR ** Colibri T30 # crc32 -v 0x80000000 0x100 9eb4f5ca
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != 301eeead ** ERROR **

WTF is going on?

Git bisection revealed the following:

3ef46a998a2f2c52e227246ac0438ca048ddfd09 is the first bad commit commit 3ef46a998a2f2c52e227246ac0438ca048ddfd09

Author: Nikolay Dimitrov <[email protected]>
Date:   Fri Dec 12 20:01:23 2014 +0200

Fix hash verification

Fix issue in parse_verify_sum() which swaps handling of env-var and
*address.
Move hash_command() argc check earlier.
Cosmetic change on do_hash() variable declaration. Improved help message for "hash" command.

:040000 040000 631448e48e845fa9a5c33600e02c7f5b8ea886b0
1a75a34d961c61729a10babb9e875ac8e66f03dc M common

git revert 3ef46a998a2f2c52e227246ac0438ca048ddfd09

Colibri T30 # crc32 0x80000000 0x100
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca
Colibri T30 # crc32 -v 0x80000000 0x100 c9a057b3
crc32 for 80000000 ... 800000ff ==> 9eb4f5ca != c9a057b3 ** ERROR ** Colibri T30 # crc32 -v 0x80000000 0x100 9eb4f5ca

Ah, that looks much better!

I will cook up a proper patch shortly...