1
0
Fork 0
cryptsetup/tests/generators/generate-luks2-invalid-checksum-hdr0.img.sh
Daniel Baumann 309c0fd158
Adding upstream version 2:2.7.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 10:45:47 +02:00

28 lines
389 B
Bash
Executable file

#!/bin/bash
. lib.sh
#
# *** Description ***
#
# generate header with bad checksum in primary binary header
#
# 1 full target dir
# 2 full source luks2 image
function generate()
{
CHKS0=$(echo "Arbitrary chosen string: D'oh!" | calc_sha256_checksum_stdin)
write_checksum $CHKS0 $TGT_IMG
}
function check()
{
lib_hdr0_checksum || exit 2
}
lib_prepare $@
generate
check
lib_cleanup