diff options
Diffstat (limited to '')
-rwxr-xr-x | tests/generators/generate-luks2-invalid-checksum-hdr1.img.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/generators/generate-luks2-invalid-checksum-hdr1.img.sh b/tests/generators/generate-luks2-invalid-checksum-hdr1.img.sh new file mode 100755 index 0000000..a56695d --- /dev/null +++ b/tests/generators/generate-luks2-invalid-checksum-hdr1.img.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +. lib.sh + +# +# *** Description *** +# +# generate header with bad checksum in secondary binary header +# + +# $1 full target dir +# $2 full source luks2 image + +function generate() +{ + CHKS1=$(echo "Arbitrary chosen string: D'oh!" | calc_sha256_checksum_stdin) + write_checksum $CHKS1 $TMPDIR/hdr1 + write_luks2_bin_hdr1 $TMPDIR/hdr1 $TGT_IMG +} + +function check() +{ + lib_hdr1_checksum || exit 2 +} + +lib_prepare $@ +generate +check +lib_cleanup |