8 # generate header with bad checksum in both binary headerer
12 # $2 full source luks2 image
17 test -d $TMPDIR || mkdir $TMPDIR
18 read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr1
23 chks0=$(echo "Arbitrary chosen string: D'oh!" | calc_sha256_checksum_stdin)
24 chks1=$(echo "D'oh!: arbitrary chosen string" | calc_sha256_checksum_stdin)
25 write_checksum $chks0 $TGT_IMG
26 write_checksum $chks1 $TMPDIR/hdr1
27 write_luks2_bin_hdr1 $TMPDIR/hdr1 $TGT_IMG
32 chks_res0=$(read_sha256_checksum $TGT_IMG)
33 chks_res1=$(read_sha256_checksum $TMPDIR/hdr1)
34 test "$chks0" = "$chks_res0" || exit 2
35 test "$chks1" = "$chks_res1" || exit 2
44 test $# -eq 2 || exit 1
46 TGT_IMG=$1/$(test_img_name $0)