File: generate-luks2-invalid-checksum-hdr0.img.sh

package info (click to toggle)
cryptsetup 2%3A2.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,624 kB
  • sloc: ansic: 62,955; sh: 16,774; cpp: 994; xml: 920; makefile: 488; perl: 486
file content (28 lines) | stat: -rwxr-xr-x 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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