Revert "libblkid: luks: add checksum support"
See discussion at https://github.com/util-linux/util-linux/pull/1801
The change is unwanted by LUKS upstream developers, the checksum
functionality is designed for libcryptsetup internal use only.
Issues:
* introduces security issue (allocated buffer is not checked agaisnt
maximal value) - inserting LUKS2 device with header faking oversized
header size will cause allocating of huge amount of memory (perhaps
crash of blkid)
* we support JSON area up to 4MB in size (checksum covers also this part
that was not intended to be read by blkid) - calculating SHA256 for
such area is really not fast operation; readin of 4MB of data is waste
of resources either (that's why there is smaill 4k binary header)
* even if checksum check is disabled, it is calculated (complete waste
of time here)
* it does not support anything else that SHA256 (we can switch to different
hash or other algorithm later); blkid should not introduce such limits.
* checksum for the second heder is not calculated at all
This reverts commit
eca0d8b8b1360f745131158bf6b5b5c1c04d98c9.
Signed-off-by: Karel Zak <kzak@redhat.com>
Addresses: https://github.com/util-linux/util-linux/pull/1801